An open API service indexing awesome lists of open source software.

https://github.com/apache/airflow-client-go

Apache Airflow - OpenApi Client for Go
https://github.com/apache/airflow-client-go

airflow apache apache-airflow apache-airflow-client go

Last synced: about 1 year ago
JSON representation

Apache Airflow - OpenApi Client for Go

Awesome Lists containing this project

README

          

Airflow Go client
=================

Go Airflow OpenAPI client generated from [openapi
spec](https://github.com/apache/airflow/blob/master/clients/gen/go.sh).

Install
-------

```
go get github.com/apache/airflow-client-go/airflow@latest
```

Usage
-----

```go
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](./airflow/README.md#documentation-for-api-endpoints) for full client API documentation.