commit | e1deffdac6529e02da148888d530ba3099644187 | [log] [tgz] |
---|---|---|
author | QP Hou <qph@scribd.com> | Sat Sep 05 22:31:02 2020 -0700 |
committer | GitHub <noreply@github.com> | Sat Sep 05 22:31:02 2020 -0700 |
tree | f210813b1d46034df84ff32c7d93fddbaf7075e5 | |
parent | 781c285536c18acbe4269cb3131e53e85e019d23 [diff] |
add test & doc for authentication (#5)
Go Airflow OpenAPI client generated from openapi spec.
import (
"github.com/apache/airflow-client-go/airflow"
)
func main() {
cli := airflow.NewAPIClient(&airflow.Configuration{
Scheme: "http",
Host: "localhost:28080",
BasePath: "/api/v1",
})
cred := airflow.BasicAuth{
UserName: "username",
Password: "password",
}
ctx := context.WithValue(context.Background(), airflow.ContextBasicAuth, cred)
variable, _, err := client.VariableApi.GetVariable(ctx, "foo")
if err != nil {
fmt.Println(variable)
} else {
fmt.Println(err)
}
}
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.