schema

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SchemaSupportsTerraform

func SchemaSupportsTerraform(v string) error

Types

type DataSource added in v0.2.0

type DataSource struct {
	Name            string
	Provider        string
	Description     string
	DescriptionKind tfjson.SchemaDescriptionKind
}

type MockReader added in v0.2.0

type MockReader struct {
	ProviderSchemas *tfjson.ProviderSchemas

	ProviderSchemaErr   error
	ProvidersErr        error
	ResourceSchemaErr   error
	ResourcesErr        error
	DataSourceSchemaErr error
	DataSourcesErr      error
}

func (*MockReader) DataSourceSchema added in v0.2.0

func (r *MockReader) DataSourceSchema(dsType string) (*tfjson.Schema, error)

func (*MockReader) DataSources added in v0.2.0

func (r *MockReader) DataSources() ([]DataSource, error)

func (*MockReader) ProviderConfigSchema added in v0.2.0

func (r *MockReader) ProviderConfigSchema(name string) (*tfjson.Schema, error)

func (*MockReader) Providers added in v0.2.0

func (r *MockReader) Providers() ([]string, error)

func (*MockReader) ResourceSchema added in v0.2.0

func (r *MockReader) ResourceSchema(rType string) (*tfjson.Schema, error)

func (*MockReader) Resources added in v0.2.0

func (r *MockReader) Resources() ([]Resource, error)

type MockWatcher

type MockWatcher struct{}

func (*MockWatcher) AddWorkspace

func (w *MockWatcher) AddWorkspace(string) error

func (*MockWatcher) Close

func (w *MockWatcher) Close() error

func (*MockWatcher) Errors

func (w *MockWatcher) Errors() chan error

func (*MockWatcher) Events

func (w *MockWatcher) Events() chan fsnotify.Event

func (*MockWatcher) OnPluginChange

func (w *MockWatcher) OnPluginChange(func(*watchedWorkspace) error)

func (*MockWatcher) SetLogger

func (w *MockWatcher) SetLogger(*log.Logger)

type NoSchemaAvailableErr added in v0.2.0

type NoSchemaAvailableErr struct{}

func (*NoSchemaAvailableErr) Error added in v0.2.0

func (e *NoSchemaAvailableErr) Error() string

type Reader

type Reader interface {
	ProviderConfigSchema(name string) (*tfjson.Schema, error)
	Providers() ([]string, error)
	ResourceSchema(rType string) (*tfjson.Schema, error)
	Resources() ([]Resource, error)
	DataSourceSchema(dsType string) (*tfjson.Schema, error)
	DataSources() ([]DataSource, error)
}

type Resource added in v0.2.0

type Resource struct {
	Name            string
	Provider        string
	Description     string
	DescriptionKind tfjson.SchemaDescriptionKind
}

type SchemaUnavailableErr

type SchemaUnavailableErr struct {
	BlockType string
	FullName  string
}

func (*SchemaUnavailableErr) Error

func (e *SchemaUnavailableErr) Error() string

type Storage

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

func MockStorage

func MockStorage(ps *tfjson.ProviderSchemas) *Storage

func NewStorage

func NewStorage() *Storage

func (*Storage) AddWorkspaceForWatching

func (s *Storage) AddWorkspaceForWatching(dir string) error

func (*Storage) DataSourceSchema

func (s *Storage) DataSourceSchema(dsType string) (*tfjson.Schema, error)

func (*Storage) DataSources added in v0.2.0

func (s *Storage) DataSources() ([]DataSource, error)

func (*Storage) ObtainSchemasForWorkspace

func (s *Storage) ObtainSchemasForWorkspace(tf *exec.Executor, dir string) error

ObtainSchemasForWorkspace will (by default) asynchronously obtain schema via tf and store it for later consumption via Reader methods

func (*Storage) ProviderConfigSchema

func (s *Storage) ProviderConfigSchema(name string) (*tfjson.Schema, error)

func (*Storage) Providers added in v0.2.0

func (s *Storage) Providers() ([]string, error)

func (*Storage) ResourceSchema

func (s *Storage) ResourceSchema(rType string) (*tfjson.Schema, error)

func (*Storage) Resources added in v0.2.0

func (s *Storage) Resources() ([]Resource, error)

func (*Storage) SetLogger

func (s *Storage) SetLogger(logger *log.Logger)

func (*Storage) SetSynchronous

func (s *Storage) SetSynchronous()

func (*Storage) StartWatching

func (s *Storage) StartWatching(tf *exec.Executor) error

StartWatching starts to watch for plugin changes in dirs that were added via AddWorkspaceForWatching until StopWatching() is called

func (*Storage) StopWatching

func (s *Storage) StopWatching() error

type Watcher

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

Watcher is a wrapper around native fsnotify.Watcher to make it swappable for MockWatcher via interface, provide higher-level ability to detect actual file changes (rather than just events that may not be changing any bytes) and hold knowledge about workspace structure

func NewWatcher

func NewWatcher() (*Watcher, error)

func (*Watcher) AddWorkspace

func (w *Watcher) AddWorkspace(dir string) error

func (*Watcher) Close

func (w *Watcher) Close() error

func (*Watcher) Errors

func (w *Watcher) Errors() chan error

func (*Watcher) Events

func (w *Watcher) Events() chan fsnotify.Event

func (*Watcher) OnPluginChange

func (w *Watcher) OnPluginChange(f func(*watchedWorkspace) error)

func (*Watcher) SetLogger

func (w *Watcher) SetLogger(logger *log.Logger)

type Writer

type Writer interface {
	ObtainSchemasForWorkspace(*exec.Executor, string) error
	AddWorkspaceForWatching(string) error
	StartWatching(*exec.Executor) error
}

Jump to

Keyboard shortcuts

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