protocol

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandShakeConfig

func HandShakeConfig() plugin.HandshakeConfig

HandShakeConfig is used to just do a basic handshake between a plugin and host. If the handshake fails, a user-friendly error is shown. This prevents users from executing bad plugins or executing a plugin directory. It is a UX feature, not a security feature.

Types

type Adapter

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

Adapter wraps a PluginSchema. It allows for omitting implementing methods as it will check if the method is set before executing it

func NewAdapter

func NewAdapter(plugin *schema.PluginSchema, logger hclog.Logger) *Adapter

NewAdapter creates a new Adapter

func (*Adapter) Configure

func (a *Adapter) Configure(environment, provider string) error

func (*Adapter) GetValidationSchema

func (a *Adapter) GetValidationSchema() (*schema.ValidationSchema, error)

func (*Adapter) Identifier

func (a *Adapter) Identifier() string

func (*Adapter) RenderTerraformComponent

func (a *Adapter) RenderTerraformComponent(site string, component string) (*schema.ComponentSchema, error)

func (*Adapter) RenderTerraformProviders

func (a *Adapter) RenderTerraformProviders(site string) (string, error)

func (*Adapter) RenderTerraformResources

func (a *Adapter) RenderTerraformResources(site string) (string, error)

func (*Adapter) SetComponentConfig

func (a *Adapter) SetComponentConfig(component string, version string, data map[string]any) error

func (*Adapter) SetComponentEndpointsConfig

func (a *Adapter) SetComponentEndpointsConfig(component string, endpoints map[string]string) error

func (*Adapter) SetGlobalConfig

func (a *Adapter) SetGlobalConfig(data map[string]any) error

func (*Adapter) SetSiteComponentConfig

func (a *Adapter) SetSiteComponentConfig(site string, component string, data map[string]any) error

func (*Adapter) SetSiteConfig

func (a *Adapter) SetSiteConfig(site string, data map[string]any) error

func (*Adapter) SetSiteEndpointConfig

func (a *Adapter) SetSiteEndpointConfig(site string, name string, data map[string]any) error

type ConfigureInput

type ConfigureInput struct {
	Environment string
	Provider    string
}

type ErrorOutput

type ErrorOutput struct {
	Err *PluginError
}

type GetValidationSchemaOutput

type GetValidationSchemaOutput struct {
	Result schema.ValidationSchema
	Err    *PluginError
}

type Plugin

type Plugin struct {
	Adapter    *Adapter
	Logger     hclog.Logger
	Identifier string
}

func (*Plugin) Client

func (p *Plugin) Client(b *plugin.MuxBroker, c *rpc.Client) (any, error)

func (*Plugin) Server

func (p *Plugin) Server(*plugin.MuxBroker) (any, error)

type PluginError

type PluginError struct {
	Message    string
	PluginName string
}

func (*PluginError) Error

func (e *PluginError) Error() string

type PluginRPC

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

func (*PluginRPC) Configure

func (p *PluginRPC) Configure(environment string, provider string) error

func (*PluginRPC) GetValidationSchema

func (p *PluginRPC) GetValidationSchema() (*schema.ValidationSchema, error)

func (*PluginRPC) Identifier

func (p *PluginRPC) Identifier() string

func (*PluginRPC) RenderTerraformComponent

func (p *PluginRPC) RenderTerraformComponent(site string, component string) (*schema.ComponentSchema, error)

func (*PluginRPC) RenderTerraformProviders

func (p *PluginRPC) RenderTerraformProviders(site string) (string, error)

func (*PluginRPC) RenderTerraformResources

func (p *PluginRPC) RenderTerraformResources(site string) (string, error)

func (*PluginRPC) SetComponentConfig

func (p *PluginRPC) SetComponentConfig(component string, version string, data map[string]any) error

func (*PluginRPC) SetComponentEndpointsConfig

func (p *PluginRPC) SetComponentEndpointsConfig(component string, endpoints map[string]string) error

func (*PluginRPC) SetGlobalConfig

func (p *PluginRPC) SetGlobalConfig(data map[string]any) error

func (*PluginRPC) SetSiteComponentConfig

func (p *PluginRPC) SetSiteComponentConfig(site string, component string, data map[string]any) error

func (*PluginRPC) SetSiteConfig

func (p *PluginRPC) SetSiteConfig(name string, data map[string]any) error

func (*PluginRPC) SetSiteEndpointConfig

func (p *PluginRPC) SetSiteEndpointConfig(site string, name string, data map[string]any) error

type PluginRPCServer

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

func (*PluginRPCServer) Configure

func (s *PluginRPCServer) Configure(args ConfigureInput, resp *ErrorOutput) error

func (*PluginRPCServer) GetValidationSchema

func (s *PluginRPCServer) GetValidationSchema(_ any, resp *GetValidationSchemaOutput) error

func (*PluginRPCServer) Identifier

func (s *PluginRPCServer) Identifier(_ any, resp *string) error

func (*PluginRPCServer) RenderTerraformComponent

func (s *PluginRPCServer) RenderTerraformComponent(
	args RenderTerraformComponentInput,
	resp *RenderTerraformComponentOutput) error

func (*PluginRPCServer) RenderTerraformProviders

func (s *PluginRPCServer) RenderTerraformProviders(
	args RenderTerraformProvidersInput,
	resp *RenderTerraformProvidersOutput) error

func (*PluginRPCServer) RenderTerraformResources

func (s *PluginRPCServer) RenderTerraformResources(
	args RenderTerraformResourcesInput,
	resp *RenderTerraformResourcesOutput) error

func (*PluginRPCServer) SetComponentConfig

func (s *PluginRPCServer) SetComponentConfig(args SetComponentConfigInput, resp *SetComponentConfigOutput) error

func (*PluginRPCServer) SetComponentEndpointsConfig

func (s *PluginRPCServer) SetComponentEndpointsConfig(args SetComponentEndpointsConfigInput, resp *SetSiteComponentConfigOutput) error

func (*PluginRPCServer) SetGlobalConfig

func (s *PluginRPCServer) SetGlobalConfig(args SetGlobalConfigInput, resp *ErrorOutput) error

func (*PluginRPCServer) SetSiteComponentConfig

func (s *PluginRPCServer) SetSiteComponentConfig(args SetSiteComponentConfigInput, resp *SetSiteComponentConfigOutput) error

func (*PluginRPCServer) SetSiteConfig

func (s *PluginRPCServer) SetSiteConfig(args SetSiteConfigInput, resp *ErrorOutput) error

func (*PluginRPCServer) SetSiteEndpointConfig

func (s *PluginRPCServer) SetSiteEndpointConfig(args SetSiteEndpointsConfigInput, resp *SetSiteEndpointsConfigOutput) error

type RenderTerraformComponentInput

type RenderTerraformComponentInput struct {
	Site      string
	Component string
}

type RenderTerraformComponentOutput

type RenderTerraformComponentOutput struct {
	Result *schema.ComponentSchema
	Err    *PluginError
}

type RenderTerraformProvidersInput

type RenderTerraformProvidersInput struct {
	Site string
}

type RenderTerraformProvidersOutput

type RenderTerraformProvidersOutput struct {
	Result string
	Err    *PluginError
}

type RenderTerraformResourcesInput

type RenderTerraformResourcesInput struct {
	Site string
}

type RenderTerraformResourcesOutput

type RenderTerraformResourcesOutput struct {
	Result string
	Err    *PluginError
}

type SetComponentConfigInput

type SetComponentConfigInput struct {
	Component string
	Version   string
	Data      map[string]any
}

type SetComponentConfigOutput

type SetComponentConfigOutput struct {
	Err *PluginError
}

type SetComponentEndpointsConfigInput

type SetComponentEndpointsConfigInput struct {
	Component string
	Endpoints map[string]string
}

type SetComponentEndpointsConfigOutput

type SetComponentEndpointsConfigOutput struct {
	Err *PluginError
}

type SetGlobalConfigInput

type SetGlobalConfigInput struct {
	Data map[string]any
}

type SetSiteComponentConfigInput

type SetSiteComponentConfigInput struct {
	Version   string
	Site      string
	Component string
	Data      map[string]any
}

type SetSiteComponentConfigOutput

type SetSiteComponentConfigOutput struct {
	Err *PluginError
}

type SetSiteConfigInput

type SetSiteConfigInput struct {
	Name string
	Data map[string]any
}

type SetSiteEndpointsConfigInput

type SetSiteEndpointsConfigInput struct {
	Site string
	Name string
	Data map[string]any
}

type SetSiteEndpointsConfigOutput

type SetSiteEndpointsConfigOutput struct {
	Err *PluginError
}

Jump to

Keyboard shortcuts

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