Documentation
¶
Index ¶
Constants ¶
View Source
const ExampleSourceConfig = `` /* 294-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func TestResource ¶
func TestResource(t *testing.T, tc ResourceTestCase)
Types ¶
type DestinationPlugin ¶
type ResourceTestCase ¶
type ResourceTestCase struct {
Plugin *SourcePlugin
Config string
// we want it to be parallel by default
NotParallel bool
// 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
// Verifiers are map from resource name to its verifiers.
// If no verifiers specified for resource (resource name is not in key set of map),
// non emptiness check of all columns in table and its relations will be performed.
Verifiers map[string][]Verifier
}
type SourcePlugin ¶
type SourcePlugin struct {
// Name of plugin i.e aws,gcp, azure etc'
Name string
// Version of the plugin
Version string
// Called upon configure call to validate and init configuration
Configure func(context.Context, *SourcePlugin, specs.SourceSpec) (schema.ClientMeta, error)
// Tables is all tables supported by this source plugin
Tables []*schema.Table
// JsonSchema for specific source plugin spec
JsonSchema string
// ExampleConfig is the example configuration for this plugin
ExampleConfig string
// Logger to call, this logger is passed to the serve.Serve Client, if not define Serve will create one instead.
Logger zerolog.Logger
// 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 (*SourcePlugin) Init ¶
func (p *SourcePlugin) Init(ctx context.Context, spec specs.SourceSpec) (*gojsonschema.Result, error)
type Verifier ¶
type Verifier func(t *testing.T, table *schema.Table, conn pgxscan.Querier, shouldSkipIgnoreInTest bool)
Verifier verifies tables specified by table schema (main table and its relations).
func VerifyAtLeastOneRow ¶
func VerifyAtLeastOneRow() Verifier
VerifyAtLeastOneRow verifies that main table from schema has at least one row
func VerifyAtMostOneOf ¶
VerifyAtMostOneOf verifies that for each row in table at most one column from oneof is not empty
func VerifyNoEmptyColumnsExcept ¶
VerifyNoEmptyColumnsExcept verifies that for each row in table its columns are not empty except passed
Click to show internal directories.
Click to hide internal directories.