source

package
v1.12.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2022 License: MPL-2.0 Imports: 24 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestPluginSync

func TestPluginSync(t *testing.T, plugin *Plugin, spec specs.Source, opts ...TestPluginOption)

Types

type Metrics

type Metrics struct {
	TableClient map[string]map[string]*TableClientMetrics
}

func (*Metrics) Equal

func (s *Metrics) Equal(other *Metrics) bool

Equal compares to stats. Mostly useful in testing

func (*Metrics) TotalErrors

func (s *Metrics) TotalErrors() uint64

func (*Metrics) TotalPanics

func (s *Metrics) TotalPanics() uint64

func (*Metrics) TotalResources

func (s *Metrics) TotalResources() uint64

type NewExecutionClientFunc

type NewExecutionClientFunc func(context.Context, zerolog.Logger, specs.Source) (schema.ClientMeta, error)

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin is the base structure required to pass to sdk.serve We take a declarative approach to API here similar to Cobra

func NewPlugin

func NewPlugin(name string, version string, tables []*schema.Table, newExecutionClient NewExecutionClientFunc) *Plugin

NewPlugin returns a new plugin with a given name, version, tables, newExecutionClient and additional options.

func (*Plugin) GeneratePluginDocs

func (p *Plugin) GeneratePluginDocs(dir, format string) error

GeneratePluginDocs creates table documentation for the source plugin based on its list of tables

func (*Plugin) Metrics

func (p *Plugin) Metrics() *Metrics

func (*Plugin) Name

func (p *Plugin) Name() string

Name return the name of this plugin

func (*Plugin) SetLogger

func (p *Plugin) SetLogger(logger zerolog.Logger)

func (*Plugin) Sync

func (p *Plugin) 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 (*Plugin) Tables

func (p *Plugin) Tables() schema.Tables

Tables returns all tables supported by this source plugin

func (*Plugin) TablesForSpec

func (p *Plugin) TablesForSpec(spec specs.Source) (schema.Tables, error)

TablesForSpec returns all tables supported by this source plugin that match the given spec. It validates the tables part of the spec and will return an error if it is found to be invalid.

func (*Plugin) Version

func (p *Plugin) Version() string

Version returns the version of this plugin

type TableClientMetrics

type TableClientMetrics struct {
	Resources uint64
	Errors    uint64
	Panics    uint64
	StartTime time.Time
	EndTime   time.Time
}

func (*TableClientMetrics) Equal

func (s *TableClientMetrics) Equal(other *TableClientMetrics) bool

type TestPluginOption

type TestPluginOption func(*testPluginOptions)

func WithTestPluginNoParallel

func WithTestPluginNoParallel() TestPluginOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL