v0.2.0
What's Changed
Breaking Changes
- Change capabilities and schema responses in
Connector
interface toCapabilitiesResponseMarshaler
andSchemaResponseMarshaler
. It's helpful to custom the response, for example, return staticbytes
directly withRawSchemaResponse
andRawCapabilitiesResponse
. - Add
Context
parameter toParseConfiguration
andTryInitState
- Add
State
parameter toGetSchema
ParseConfiguration(ctx context.Context, configurationDir string) (*Configuration, error)
TryInitState(ctx context.Context, configuration *Configuration, metrics *TelemetryState) (*State, error)
GetCapabilities(configuration *Configuration) schema.CapabilitiesResponseMarshaler
GetSchema(ctx context.Context, configuration *Configuration, state *State) (schema.SchemaResponseMarshaler, error)
Highlights
Customize the CLI
The SDK uses Kong, a lightweight command-line parser to implement the CLI interface.
The default CLI already implements the serve
command, so you don't need to do anything. If you want to add more custom commands, the SDK abstracts an interface for the CLI that requires embedding the base ServeCLI
command and can execute other commands.
type ConnectorCLI interface {
GetServeCLI() *ServeCLI
Execute(ctx context.Context, command string) error
}
And use the StartCustom
function to start the CLI.
See the custom CLI example in the reference connector.
Changelog
- restructure schema package and add more unmarshal utils by @hgiasac in #27
- add state argument to
GetSchema
method by @hgiasac in #29 - Extend CLI interface and add context to
ParseConfiguration
andTryInitState
methods by @hgiasac in #31 - fix invalid capabilities version by @hgiasac in #33
- introduce capabilities schema marshalers by @hgiasac in #35
Full Changelog: v0.1.3...v0.2.0