Documentation
¶
Overview ¶
Package plugins defines APIs for source and destination plugins
Index ¶
- func TestSourcePluginSync(t *testing.T, plugin *SourcePlugin, spec specs.Source)
- type DestinationPlugin
- type ResourceTestCase
- type SourceNewExecutionClientFunc
- type SourceOption
- type SourcePlugin
- func (p *SourcePlugin) GenerateSourcePluginDocs(dir string) error
- func (p *SourcePlugin) Name() string
- func (p *SourcePlugin) SetLogger(log zerolog.Logger)
- func (p *SourcePlugin) Sync(ctx context.Context, spec specs.Source, res chan<- *schema.Resource) error
- func (p *SourcePlugin) Tables() schema.Tables
- func (p *SourcePlugin) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestSourcePluginSync ¶ added in v0.0.4
func TestSourcePluginSync(t *testing.T, plugin *SourcePlugin, spec specs.Source)
Types ¶
type DestinationPlugin ¶
type ResourceTestCase ¶
type ResourceTestCase struct { Plugin *SourcePlugin Spec specs.Source // ParallelFetchingLimit limits parallel resources fetch at a time ParallelFetchingLimit uint64 // SkipIgnoreInTest flag which detects if schema.Table or schema.Column should be ignored SkipIgnoreInTest bool }
type SourceNewExecutionClientFunc ¶ added in v0.0.4
type SourceOption ¶ added in v0.0.4
type SourceOption func(*SourcePlugin)
func WithSourceLogger ¶ added in v0.0.4
func WithSourceLogger(logger zerolog.Logger) SourceOption
type SourcePlugin ¶
type SourcePlugin struct {
// contains filtered or unexported fields
}
SourcePlugin is the base structure required to pass to sdk.serve We take a similar/declerative approach to API here similar to Cobra
func NewSourcePlugin ¶ added in v0.0.4
func NewSourcePlugin(name string, version string, tables []*schema.Table, newExecutionClient SourceNewExecutionClientFunc, opts ...SourceOption) *SourcePlugin
NewSourcePlugin returns a new plugin with a given name, version, tables, newExecutionClient and additional options.
func (*SourcePlugin) GenerateSourcePluginDocs ¶ added in v0.6.4
func (p *SourcePlugin) GenerateSourcePluginDocs(dir string) error
GenerateSourcePluginDocs creates table documentation for the source plugin based on its list of tables
func (*SourcePlugin) Name ¶
func (p *SourcePlugin) Name() string
Name return the name of this plugin
func (*SourcePlugin) SetLogger ¶ added in v0.0.4
func (p *SourcePlugin) SetLogger(log zerolog.Logger)
SetLogger sets the logger for this plugin which will be used in Sync and all other function calls.
func (*SourcePlugin) Sync ¶ added in v0.0.4
func (p *SourcePlugin) Sync(ctx context.Context, spec specs.Source, res chan<- *schema.Resource) error
Sync is syncing data from the requested tables in spec to the given channel
func (*SourcePlugin) Tables ¶
func (p *SourcePlugin) Tables() schema.Tables
Tables returns all supported tables by this source plugin
func (*SourcePlugin) Version ¶
func (p *SourcePlugin) Version() string
Version returns the version of this plugin