datarouter

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDataSource

func RegisterDataSource(data DataSource) func(Router) Router

RegisterDataSource registers a DataSource with the Router.

Types

type DataSource

type DataSource interface {
	DataSourceServerAdapter
	Name() string
	Schema() *tfprotov6.Schema
	SetProviderConfig(val tftypes.Value) error
}

DataSource is the DataSource.

type DataSourceServerAdapter

type DataSourceServerAdapter interface {
	ValidateDataResourceConfig(ctx context.Context, req tfprotov6.ValidateDataResourceConfigRequest, res *tfprotov6.ValidateDataResourceConfigResponse)
	ReadDataSource(ctx context.Context, req tfprotov6.ReadDataSourceRequest, res *tfprotov6.ReadDataSourceResponse)
}

DataSourceServerAdapter Adapter for a tfprotov6.DataSourceServer removing the error return type from all methods.

type Router

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

Router routes requests to the various data resources.

func New

func New(opts ...RouterOpt) Router

New takes zero or more functional options and return a new DataSource router.

func (Router) ReadDataSource

ReadDataSource refreshes the data sources state.

func (Router) Schemas

func (r Router) Schemas() map[string]*tfprotov6.Schema

Schemas returns the data router schemas.

func (Router) ValidateDataResourceConfig

ValidateDataResourceConfig validates the data sources config.

type RouterOpt

type RouterOpt func(Router) Router

RouterOpt is a functional option for the data router.

Jump to

Keyboard shortcuts

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