{"modulePath":"github.com/cloudquery/plugin-sdk/v2","version":"v2.3.2","isLatest":false,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package source\n\n## Variables\n\n```go\nvar DefaultTitleExceptions = map[string]string{\n\n\t\"acl\":   \"ACL\",\n\t\"acls\":  \"ACLs\",\n\t\"api\":   \"API\",\n\t\"apis\":  \"APIs\",\n\t\"ca\":    \"CA\",\n\t\"cidr\":  \"CIDR\",\n\t\"cidrs\": \"CIDRs\",\n\t\"db\":    \"DB\",\n\t\"dbs\":   \"DBs\",\n\t\"dhcp\":  \"DHCP\",\n\t\"iam\":   \"IAM\",\n\t\"iot\":   \"IOT\",\n\t\"ip\":    \"IP\",\n\t\"ips\":   \"IPs\",\n\t\"ipv4\":  \"IPv4\",\n\t\"ipv6\":  \"IPv6\",\n\t\"mfa\":   \"MFA\",\n\t\"ml\":    \"ML\",\n\t\"oauth\": \"OAuth\",\n\t\"vpc\":   \"VPC\",\n\t\"vpcs\":  \"VPCs\",\n\t\"vpn\":   \"VPN\",\n\t\"vpns\":  \"VPNs\",\n\t\"waf\":   \"WAF\",\n\t\"wafs\":  \"WAFs\",\n\n\t\"aws\": \"AWS\",\n\t\"gcp\": \"GCP\",\n}\n```\n\n## Functions\n\n```go\nfunc DefaultTitleTransformer(table *schema.Table) string\n```\n\n```go\nfunc TestPluginSync(t *testing.T, plugin *Plugin, spec specs.Source, opts ...TestPluginOption)\n```\n\n## Types\n\n```go\ntype GetTables func(ctx context.Context, c schema.ClientMeta) (schema.Tables, error)\n```\n\n```go\ntype Metrics struct {\n\tTableClient map[string]map[string]*TableClientMetrics\n}\n```\n\n```go\nfunc (s *Metrics) Equal(other *Metrics) bool\n```\nEqual compares to stats. Mostly useful in testing\n\n```go\nfunc (s *Metrics) TotalErrors() uint64\n```\n\n```go\nfunc (s *Metrics) TotalErrorsAtomic() uint64\n```\n\n```go\nfunc (s *Metrics) TotalPanics() uint64\n```\n\n```go\nfunc (s *Metrics) TotalPanicsAtomic() uint64\n```\n\n```go\nfunc (s *Metrics) TotalResources() uint64\n```\n\n```go\nfunc (s *Metrics) TotalResourcesAtomic() uint64\n```\n\n```go\ntype NewExecutionClientFunc func(context.Context, zerolog.Logger, specs.Source, Options) (schema.ClientMeta, error)\n```\n\n```go\ntype Option func(*Plugin)\n```\n\n```go\nfunc WithDynamicTableOption(getDynamicTables GetTables) Option\n```\nWithDynamicTableOption allows the plugin to return list of tables after call to New\n\n```go\nfunc WithNoInternalColumns() Option\n```\nWithNoInternalColumns won't add internal columns (\\_cq\\_id, \\_cq\\_parent\\_cq\\_id) to the plugin tables\n\n```go\nfunc WithTitleTransformer(t func(*schema.Table) string) Option\n```\nWithTitleTransformer allows the plugin to control how table names get turned into titles for the generated documentation.\n\n```go\nfunc WithUnmanaged() Option\n```\n\n```go\ntype Options struct {\n\tBackend backend.Backend\n}\n```\n\n```go\ntype Plugin struct {\n\t// contains filtered or unexported fields\n}\n```\nPlugin is the base structure required to pass to sdk.serve We take a declarative approach to API here similar to Cobra\n\n```go\nfunc NewPlugin(name string, version string, tables []*schema.Table, newExecutionClient NewExecutionClientFunc, options ...Option) *Plugin\n```\nNewPlugin returns a new plugin with a given name, version, tables, newExecutionClient and additional options.\n\n```go\nfunc (p *Plugin) Close(ctx context.Context) error\n```\n\n```go\nfunc (p *Plugin) GeneratePluginDocs(dir, format string) error\n```\nGeneratePluginDocs creates table documentation for the source plugin based on its list of tables\n\n```go\nfunc (p *Plugin) GetDynamicTables() schema.Tables\n```\n\n```go\nfunc (p *Plugin) HasDynamicTables() bool\n```\n\n```go\nfunc (p *Plugin) Init(ctx context.Context, spec specs.Source) error\n```\n\n```go\nfunc (p *Plugin) Metrics() *Metrics\n```\n\n```go\nfunc (p *Plugin) Name() string\n```\nName return the name of this plugin\n\n```go\nfunc (p *Plugin) SetLogger(logger zerolog.Logger)\n```\n\n```go\nfunc (p *Plugin) Sync(ctx context.Context, res chan\u003c- *schema.Resource) error\n```\nSync is syncing data from the requested tables in spec to the given channel\n\n```go\nfunc (p *Plugin) Tables() schema.Tables\n```\nTables returns all tables supported by this source plugin\n\n```go\nfunc (p *Plugin) TablesForSpec(spec specs.Source) (schema.Tables, error)\n```\nTablesForSpec 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. This is deprecated method\n\n```go\nfunc (p *Plugin) Version() string\n```\nVersion returns the version of this plugin\n\n```go\ntype TableClientMetrics struct {\n\tResources uint64\n\tErrors    uint64\n\tPanics    uint64\n\tStartTime time.Time\n\tEndTime   time.Time\n}\n```\n\n```go\nfunc (s *TableClientMetrics) Equal(other *TableClientMetrics) bool\n```\n\n```go\ntype TestPluginOption func(*testPluginOptions)\n```\n\n```go\nfunc WithTestPluginAdditionalValidators(v Validator) TestPluginOption\n```\n\n```go\nfunc WithTestPluginNoParallel() TestPluginOption\n```\n\n```go\ntype UnmanagedClient interface {\n\tschema.ClientMeta\n\tSync(ctx context.Context, metrics *Metrics, res chan\u003c- *schema.Resource) error\n}\n```\n\n```go\ntype Validator func(t *testing.T, plugin *Plugin, resources []*schema.Resource)\n```\n\n","path":"github.com/cloudquery/plugin-sdk/v2/plugins/source","name":"source","synopsis":"","isRedistributable":true}
