This is a go SDK for Spring Cloud DataFlow's Open API generated by Kiota
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)
- Extract OpenAPI Specification from Spring Cloud DataFlow (
http://localhost:9393/v3/api-docs
) by starting docker-compose setup with following extra environment variables indata-flow-server
:
SPRINGDOC_API_DOCS_ENABLED=True
SPRINGDOC_SWAGGER_UI_ENABLED=True
-
Insert extracted OpenAPI Specification into file
./dataflow-api.yml
-
Install kiota binaries: https://learn.microsoft.com/en-us/openapi/kiota/install?tabs=bash#download-binaries
-
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
- tidy, compile and test
go mod tidy
go test ./...
-
Commit, Tag and Push
-
Make the module available (see here)
GOPROXY=proxy.golang.org go list -m github.com/denniskniep/spring-cloud-dataflow-sdk-go/v2@<version>
Created by following this Guide