provider

package
v0.3.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MPL-2.0 Imports: 20 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	// Example returns a configuration example (with comments) so user clients can generate an example config
	Example() string
}

Config Every provider implements a resources field we only want to extract that in fetch execution

type Migrator

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

Migrator handles creation of schema.Table in database if they don't exist, and migration of tables if provider was upgraded.

func NewMigrator

func NewMigrator(log hclog.Logger) *Migrator

func (Migrator) CreateTable

func (m Migrator) CreateTable(ctx context.Context, conn *pgxpool.Conn, t *schema.Table, parent *schema.Table) error

type Provider

type Provider struct {
	// Name of plugin i.e aws,gcp, azure etc'
	Name string
	// Version of the provider
	Version string
	// Configure the provider and return context
	Configure func(hclog.Logger, interface{}) (schema.ClientMeta, error)
	// ResourceMap is all resources supported by this plugin
	ResourceMap map[string]*schema.Table
	// Configuration decoded from configure request
	Config func() Config
	// Logger to call, this logger is passed to the serve.Serve Client, if not define Serve will create one instead.
	Logger hclog.Logger
	// contains filtered or unexported fields
}

Provider is the base structure required to pass and serve an sdk provider.Provider

func (*Provider) ConfigureProvider added in v0.2.0

func (*Provider) FetchResources added in v0.2.0

func (p *Provider) FetchResources(ctx context.Context, request *cqproto.FetchResourcesRequest, sender cqproto.FetchResourcesSender) error

func (*Provider) GetProviderConfig added in v0.2.0

func (*Provider) GetProviderSchema added in v0.2.0

Directories

Path Synopsis
Package docs helps create provider documentation
Package docs helps create provider documentation

Jump to

Keyboard shortcuts

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