commit | b125451e80fd4da7038ceaea7654c885d155fb46 | [log] [tgz] |
---|---|---|
author | Adam Boscarino <adam@bosco.codes> | Thu Dec 02 14:17:15 2021 -0500 |
committer | GitHub <noreply@github.com> | Thu Dec 02 11:17:15 2021 -0800 |
tree | 79d75f7c96fae026a0d26f03e68182eb162042e7 | |
parent | c4bfdb8caedb290bf002cf40aa4ec1414dcc2554 [diff] |
Update Go Client for Airflow 2.2.2 (#13) * upgrade go client to latest api spec using openapi-generator 5.x * run pre-commit hook to add licenses
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.
Go client is versioned using semantic import versioning.
To release a new version 1.x.y
, simply push a new tag to this repo named airflow/v1.x.y
.
Major version upgrade requires changing package import path based on semantic import versioning, which needs to be done manually.