commit | cbb2942bb0ca7207ddf244e609a1ef1ca744ed79 | [log] [tgz] |
---|---|---|
author | Ephraim Anierobi <splendidzigy24@gmail.com> | Mon May 01 09:49:21 2023 +0100 |
committer | Ephraim Anierobi <splendidzigy24@gmail.com> | Tue May 02 12:22:55 2023 +0100 |
tree | db0682144b8bff0cea3d608f999d60ccf22e57b4 | |
parent | 8ce0b39cfbb2b45d360ffb00e40897319d085d15 [diff] |
Add Client Version 2.6.0
Go Airflow OpenAPI client generated from openapi spec.
go get github.com/apache/airflow-client-go/airflow@latest
package main
import (
"context"
"fmt"
"github.com/apache/airflow-client-go/airflow"
)
func main() {
conf := airflow.NewConfiguration()
conf.Host = "localhost:8080"
conf.Scheme = "http"
cli := airflow.NewAPIClient(conf)
cred := airflow.BasicAuth{
UserName: "username",
Password: "password",
}
ctx := context.WithValue(context.Background(), airflow.ContextBasicAuth, cred)
variable, _, err := cli.VariableApi.GetVariable(ctx, "foo").Execute()
if err != nil {
fmt.Println(err)
} else {
fmt.Println(variable)
}
}
See README for full client API documentation.