Apache Airflow - OpenApi Client for Go

Clone this repo:
  1. 8ce0b39 Add install instructions and update top level dependancies. (#42) by Pierre Jeambrun · 1 year, 3 months ago main
  2. 7af9875 Generate client version 2.5.0 (#29) by Pierre Jeambrun · 1 year, 3 months ago
  3. f2e573c Add step to add release data to Committee Report Helper (#40) by Ephraim Anierobi · 1 year, 3 months ago
  4. 1eb906a Remove extra spaces in LICENSE (#39) by Jed Cunningham · 1 year, 3 months ago
  5. e2980e5 Update the signing command (#37) by Ephraim Anierobi · 1 year, 3 months ago

Airflow Go client

Go Airflow OpenAPI client generated from openapi spec.

Install

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

Usage

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.