commit | 8ce0b39cfbb2b45d360ffb00e40897319d085d15 | [log] [tgz] |
---|---|---|
author | Pierre Jeambrun <pierrejbrun@gmail.com> | Sat Feb 11 00:47:54 2023 +0100 |
committer | GitHub <noreply@github.com> | Sat Feb 11 00:47:54 2023 +0100 |
tree | 838fac01449a479b973d0b7f5606a6f4b6508e53 | |
parent | 7af9875e7d4cbfbba4fe5b05fddcd4547edf8b87 [diff] |
Add install instructions and update top level dependancies. (#42)
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.