commit | c4bfdb8caedb290bf002cf40aa4ec1414dcc2554 | [log] [tgz] |
---|---|---|
author | QP Hou <qph@scribd.com> | Thu Jun 17 23:37:01 2021 -0700 |
committer | GitHub <noreply@github.com> | Thu Jun 17 23:37:01 2021 -0700 |
tree | 8ca54968ba5f08c1f93f4777cbf4d9c3a5b6676f | |
parent | 275741a25d9594b77a9110d194fdebbc2e7f51b8 [diff] |
upgrade go client to latest api spec using openapi-generator 5.x (#10) * update go client with latest openapi spec and openapi generator 5.x * update example and test to use new API * add golang 1.16 to test matrix
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.