provider

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MPL-2.0 Imports: 16 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFunctionName

func GetFunctionName(i interface{}) string

Types

type Config

type Config struct {
	// global timeout in seconds
	Timeout   int `yaml:"timeout" default:"1200"`
	Resources []struct {
		Name  string
		Other map[string]interface{} `yaml:",inline"`
	}
}

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

func NewMigrator

func NewMigrator(db schema.Database, log hclog.Logger) Migrator

func (Migrator) CreateTable

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

type Provider

type Provider struct {
	// Name of plugin i.e aws,gcp, azure etc'
	Name 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 unmarshalled from Fetch request
	Config func() interface{}
	// Logger to call
	Logger hclog.Logger
	// DefaultConfigGenerator generates the default configuration for a client to execute this provider
	DefaultConfigGenerator func() (string, error)
	// contains filtered or unexported fields
}

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

func (*Provider) Fetch

func (p *Provider) Fetch(data []byte) error

func (*Provider) GenConfig

func (p *Provider) GenConfig() (string, error)

func (*Provider) Init

func (p *Provider) Init(_ string, dsn string, _ bool) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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