Documentation ¶
Index ¶
- Variables
- func DefaultTitleTransformer(table *schema.Table) string
- func TestPluginSync(t *testing.T, plugin *Plugin, spec specs.Source, opts ...TestPluginOption)
- type GetTables
- type Metrics
- func (s *Metrics) Equal(other *Metrics) bool
- func (s *Metrics) TotalErrors() uint64
- func (s *Metrics) TotalErrorsAtomic() uint64
- func (s *Metrics) TotalPanics() uint64
- func (s *Metrics) TotalPanicsAtomic() uint64
- func (s *Metrics) TotalResources() uint64
- func (s *Metrics) TotalResourcesAtomic() uint64
- type NewExecutionClientFunc
- type Option
- type Options
- type Plugin
- func (p *Plugin) Close(ctx context.Context) error
- func (p *Plugin) GeneratePluginDocs(dir, format string) error
- func (p *Plugin) GetDynamicTables() schema.Tables
- func (p *Plugin) HasDynamicTables() bool
- func (p *Plugin) Init(ctx context.Context, spec specs.Source) error
- func (p *Plugin) Metrics() *Metrics
- func (p *Plugin) Name() string
- func (p *Plugin) SetLogger(logger zerolog.Logger)
- func (p *Plugin) Sync(ctx context.Context, res chan<- *schema.Resource) error
- func (p *Plugin) Tables() schema.Tables
- func (p *Plugin) TablesForSpec(spec specs.Source) (schema.Tables, error)
- func (p *Plugin) Version() string
- type TableClientMetrics
- type TestPluginOption
- type UnmanagedClient
- type Validator
Constants ¶
This section is empty.
Variables ¶
var DefaultTitleExceptions = map[string]string{
"acl": "ACL",
"acls": "ACLs",
"api": "API",
"apis": "APIs",
"ca": "CA",
"cidr": "CIDR",
"cidrs": "CIDRs",
"db": "DB",
"dbs": "DBs",
"dhcp": "DHCP",
"iam": "IAM",
"iot": "IOT",
"ip": "IP",
"ips": "IPs",
"ipv4": "IPv4",
"ipv6": "IPv6",
"mfa": "MFA",
"ml": "ML",
"oauth": "OAuth",
"vpc": "VPC",
"vpcs": "VPCs",
"vpn": "VPN",
"vpns": "VPNs",
"waf": "WAF",
"wafs": "WAFs",
"aws": "AWS",
"gcp": "GCP",
}
Functions ¶
func DefaultTitleTransformer ¶
func TestPluginSync ¶
Types ¶
type Metrics ¶
type Metrics struct {
TableClient map[string]map[string]*TableClientMetrics
}
func (*Metrics) TotalErrors ¶
func (*Metrics) TotalErrorsAtomic ¶
func (*Metrics) TotalPanics ¶
func (*Metrics) TotalPanicsAtomic ¶
func (*Metrics) TotalResources ¶
func (*Metrics) TotalResourcesAtomic ¶
type NewExecutionClientFunc ¶
type Option ¶
type Option func(*Plugin)
func WithDynamicTableOption ¶
WithDynamicTableOption allows the plugin to return list of tables after call to New
func WithNoInternalColumns ¶
func WithNoInternalColumns() Option
WithNoInternalColumns won't add internal columns (_cq_id, _cq_parent_cq_id) to the plugin tables
func WithTitleTransformer ¶
WithTitleTransformer allows the plugin to control how table names get turned into titles for the generated documentation.
func WithUnmanaged ¶
func WithUnmanaged() Option
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, options ...Option) *Plugin
NewPlugin returns a new plugin with a given name, version, tables, newExecutionClient and additional options.
func (*Plugin) GeneratePluginDocs ¶
GeneratePluginDocs creates table documentation for the source plugin based on its list of tables
func (*Plugin) GetDynamicTables ¶
func (*Plugin) HasDynamicTables ¶
func (*Plugin) TablesForSpec ¶
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. This is deprecated method
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 WithTestPluginAdditionalValidators ¶
func WithTestPluginAdditionalValidators(v Validator) TestPluginOption
func WithTestPluginNoParallel ¶
func WithTestPluginNoParallel() TestPluginOption