Skip to content

denniskniep/spring-cloud-dataflow-sdk-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Cloud DataFlow - Go SDK

This is a go SDK for Spring Cloud DataFlow's Open API generated by Kiota

Use

go get github.com/denniskniep/spring-cloud-dataflow-sdk-go/v2@v2.11.2-prerelease1

Example

// API requires no authentication, so use the anonymous
// authentication provider
authProvider := auth.AnonymousAuthenticationProvider{}

// Create request adapter using the net/http-based implementation
adapter, err := http.NewNetHttpRequestAdapter(&authProvider)
if err != nil {
    return nil, err
}

// Create the API client
client := client.NewDataFlowClient(adapter)


result, err := client.Apps().ByType(app.Type).ByName(app.Name).ByVersion(app.Version).Get(ctx, nil)

(Re-) Generate

  1. Extract OpenAPI Specification from Spring Cloud DataFlow (http://localhost:9393/v3/api-docs) by starting docker-compose setup with following extra environment variables in data-flow-server:
SPRINGDOC_API_DOCS_ENABLED=True
SPRINGDOC_SWAGGER_UI_ENABLED=True
  1. Insert extracted OpenAPI Specification into file ./dataflow-api.yml

  2. Install kiota binaries: https://learn.microsoft.com/en-us/openapi/kiota/install?tabs=bash#download-binaries

  3. Run Code generation

kiota generate -l go -c DataFlowClient -n github.com/denniskniep/spring-cloud-dataflow-sdk-go/v2/client -d ./dataflow-api.yml -o ./client
  1. tidy, compile and test
go mod tidy
go test ./...
  1. Commit, Tag and Push

  2. Make the module available (see here)

GOPROXY=proxy.golang.org go list -m github.com/denniskniep/spring-cloud-dataflow-sdk-go/v2@<version>

Other

Created by following this Guide