commit | 7af9875e7d4cbfbba4fe5b05fddcd4547edf8b87 | [log] [tgz] |
---|---|---|
author | Pierre Jeambrun <pierrejbrun@gmail.com> | Fri Feb 03 18:59:43 2023 +0100 |
committer | GitHub <noreply@github.com> | Fri Feb 03 18:59:43 2023 +0100 |
tree | 9e0cf1c9ce87975b98923a1fd0a0fd615f6c82d6 | |
parent | f2e573c29cfdd22a34f0d2e0aa3175b6b52fb60f [diff] |
Generate client version 2.5.0 (#29) * Version 2.5.0 * Add CHANGELOG.md
Go Airflow OpenAPI client generated from openapi spec.
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.