Skip to content

v0.2.0

Compare
Choose a tag to compare
@hgiasac hgiasac released this 12 Mar 08:37
· 52 commits to v0 since this release
78a0062

What's Changed

Breaking Changes

  • Change capabilities and schema responses in Connector interface to CapabilitiesResponseMarshaler and SchemaResponseMarshaler. It's helpful to custom the response, for example, return static bytes directly with RawSchemaResponse and RawCapabilitiesResponse.
  • Add Context parameter to ParseConfiguration and TryInitState
  • Add State parameter to GetSchema
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 and TryInitState 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