Documentation ¶
Index ¶
- func NewMockPluginV1() schema.MachComposerPlugin
- type LogAdapter
- func (l *LogAdapter) Debug(msg string, args ...interface{})
- func (l *LogAdapter) Error(msg string, args ...interface{})
- func (l *LogAdapter) GetLevel() hclog.Level
- func (l *LogAdapter) ImpliedArgs() []interface{}
- func (l *LogAdapter) Info(msg string, args ...interface{})
- func (l *LogAdapter) IsDebug() bool
- func (l *LogAdapter) IsError() bool
- func (l *LogAdapter) IsInfo() bool
- func (l *LogAdapter) IsTrace() bool
- func (l *LogAdapter) IsWarn() bool
- func (l *LogAdapter) Log(level hclog.Level, msg string, args ...interface{})
- func (l *LogAdapter) Name() string
- func (l *LogAdapter) Named(name string) hclog.Logger
- func (l *LogAdapter) ResetNamed(name string) hclog.Logger
- func (l *LogAdapter) SetLevel(level hclog.Level)
- func (l *LogAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger
- func (l *LogAdapter) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer
- func (l *LogAdapter) Trace(msg string, args ...interface{})
- func (l *LogAdapter) Warn(msg string, args ...interface{})
- func (l *LogAdapter) With(args ...interface{}) hclog.Logger
- type MockPlugin
- type PluginConfig
- type PluginError
- type PluginHandler
- type PluginNotFoundError
- type PluginRepository
- func (p *PluginRepository) Add(name string, machComposerPlugin schemav2.MachComposerPlugin) error
- func (p *PluginRepository) All() []*PluginHandler
- func (p *PluginRepository) Close()
- func (p *PluginRepository) Get(name string) (*PluginHandler, error)
- func (p *PluginRepository) GetSchema(name string) (*schemav2.ValidationSchema, error)
- func (p *PluginRepository) LoadPlugin(ctx context.Context, name string, config PluginConfig) error
- func (p *PluginRepository) Names(names ...string) []PluginHandler
- type PluginV1Adapter
- func (p *PluginV1Adapter) Configure(environment string, provider string) error
- func (p *PluginV1Adapter) GetValidationSchema() (*schemav2.ValidationSchema, error)
- func (p *PluginV1Adapter) Identifier() string
- func (p *PluginV1Adapter) RenderTerraformComponent(site string, component string) (*schemav2.ComponentSchema, error)
- func (p *PluginV1Adapter) RenderTerraformProviders(site string) (string, error)
- func (p *PluginV1Adapter) RenderTerraformResources(site string) (string, error)
- func (p *PluginV1Adapter) SetComponentConfig(component string, _ string, data map[string]any) error
- func (p *PluginV1Adapter) SetComponentEndpointsConfig(component string, data map[string]string) error
- func (p *PluginV1Adapter) SetGlobalConfig(data map[string]any) error
- func (p *PluginV1Adapter) SetSiteComponentConfig(site string, component string, data map[string]any) error
- func (p *PluginV1Adapter) SetSiteConfig(site string, data map[string]any) error
- func (p *PluginV1Adapter) SetSiteEndpointConfig(site string, name string, data map[string]any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockPluginV1 ¶
func NewMockPluginV1() schema.MachComposerPlugin
Types ¶
type LogAdapter ¶
type LogAdapter struct {
// contains filtered or unexported fields
}
func NewHCLogAdapter ¶
func NewHCLogAdapter(logger zerolog.Logger) *LogAdapter
func (*LogAdapter) Debug ¶
func (l *LogAdapter) Debug(msg string, args ...interface{})
Emit a message and key/value pairs at the DEBUG level
func (*LogAdapter) Error ¶
func (l *LogAdapter) Error(msg string, args ...interface{})
Emit a message and key/value pairs at the ERROR level
func (*LogAdapter) GetLevel ¶
func (l *LogAdapter) GetLevel() hclog.Level
func (*LogAdapter) ImpliedArgs ¶
func (l *LogAdapter) ImpliedArgs() []interface{}
ImpliedArgs returns With key/value pairs
func (*LogAdapter) Info ¶
func (l *LogAdapter) Info(msg string, args ...interface{})
Emit a message and key/value pairs at the INFO level
func (*LogAdapter) IsDebug ¶
func (l *LogAdapter) IsDebug() bool
Indicate if DEBUG logs would be emitted. This and the other Is* guards
func (*LogAdapter) IsError ¶
func (l *LogAdapter) IsError() bool
Indicate if ERROR logs would be emitted. This and the other Is* guards
func (*LogAdapter) IsInfo ¶
func (l *LogAdapter) IsInfo() bool
Indicate if INFO logs would be emitted. This and the other Is* guards
func (*LogAdapter) IsTrace ¶
func (l *LogAdapter) IsTrace() bool
Indicate if TRACE logs would be emitted. This and the other Is* guards are used to elide expensive logging code based on the current level.
func (*LogAdapter) IsWarn ¶
func (l *LogAdapter) IsWarn() bool
Indicate if WARN logs would be emitted. This and the other Is* guards
func (*LogAdapter) Log ¶
func (l *LogAdapter) Log(level hclog.Level, msg string, args ...interface{})
func (*LogAdapter) Named ¶
func (l *LogAdapter) Named(name string) hclog.Logger
Create a logger that will prepend the name string on the front of all messages. If the logger already has a name, the new value will be appended to the current name. That way, a major subsystem can use this to decorate all it's own logs without losing context.
func (*LogAdapter) ResetNamed ¶
func (l *LogAdapter) ResetNamed(name string) hclog.Logger
Create a logger that will prepend the name string on the front of all messages. This sets the name of the logger to the value directly, unlike Named which honor the current name as well.
func (*LogAdapter) SetLevel ¶
func (l *LogAdapter) SetLevel(level hclog.Level)
Updates the level. This should affect all related loggers as well, unless they were created with IndependentLevels. If an implementation cannot update the level on the fly, it should no-op.
func (*LogAdapter) StandardLogger ¶
func (l *LogAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger
Return a value that conforms to the stdlib log.LogAdapter interface
func (*LogAdapter) StandardWriter ¶
func (l *LogAdapter) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer
Return a value that conforms to io.Writer, which can be passed into log.SetOutput()
func (*LogAdapter) Trace ¶
func (l *LogAdapter) Trace(msg string, args ...interface{})
func (*LogAdapter) Warn ¶
func (l *LogAdapter) Warn(msg string, args ...interface{})
Emit a message and key/value pairs at the WARN level
func (*LogAdapter) With ¶
func (l *LogAdapter) With(args ...interface{}) hclog.Logger
Creates a sublogger that will always have the given key/value pairs
type MockPlugin ¶
func (*MockPlugin) Configure ¶
func (p *MockPlugin) Configure(environment string, provider string) error
func (*MockPlugin) GetValidationSchema ¶
func (p *MockPlugin) GetValidationSchema() (*schema.ValidationSchema, error)
func (*MockPlugin) RenderTerraformComponent ¶
func (p *MockPlugin) RenderTerraformComponent(site string, component string) (*schema.ComponentSchema, error)
type PluginConfig ¶
type PluginError ¶
type PluginError struct {
// contains filtered or unexported fields
}
func (*PluginError) Error ¶
func (e *PluginError) Error() string
type PluginHandler ¶
type PluginHandler struct { schemav2.MachComposerPlugin Name string Config PluginConfig // contains filtered or unexported fields }
func (*PluginHandler) Close ¶
func (p *PluginHandler) Close()
type PluginNotFoundError ¶
type PluginNotFoundError struct {
// contains filtered or unexported fields
}
func (*PluginNotFoundError) Error ¶
func (e *PluginNotFoundError) Error() string
type PluginRepository ¶
type PluginRepository struct {
// contains filtered or unexported fields
}
func NewPluginRepository ¶
func NewPluginRepository() *PluginRepository
func (*PluginRepository) Add ¶
func (p *PluginRepository) Add(name string, machComposerPlugin schemav2.MachComposerPlugin) error
Add an existing plugin to the repository. Only used for testing purposes
func (*PluginRepository) All ¶
func (p *PluginRepository) All() []*PluginHandler
All returns all the plugin names in the repository, ordered by the plugin name
func (*PluginRepository) Close ¶
func (p *PluginRepository) Close()
Close kills all the running handlers
func (*PluginRepository) Get ¶
func (p *PluginRepository) Get(name string) (*PluginHandler, error)
Get returns the plugin from the repository
func (*PluginRepository) GetSchema ¶
func (p *PluginRepository) GetSchema(name string) (*schemav2.ValidationSchema, error)
func (*PluginRepository) LoadPlugin ¶
func (p *PluginRepository) LoadPlugin(ctx context.Context, name string, config PluginConfig) error
LoadPlugin will load the plugin with the given name and Start it
func (*PluginRepository) Names ¶
func (p *PluginRepository) Names(names ...string) []PluginHandler
type PluginV1Adapter ¶
type PluginV1Adapter struct {
// contains filtered or unexported fields
}
PluginV1Adapter will adapt the old v1 plugin to work with the new v2 settings
func NewPluginV1Adapter ¶
func NewPluginV1Adapter(p schemav1.MachComposerPlugin) *PluginV1Adapter
func (*PluginV1Adapter) Configure ¶
func (p *PluginV1Adapter) Configure(environment string, provider string) error
func (*PluginV1Adapter) GetValidationSchema ¶
func (p *PluginV1Adapter) GetValidationSchema() (*schemav2.ValidationSchema, error)
func (*PluginV1Adapter) Identifier ¶
func (p *PluginV1Adapter) Identifier() string
func (*PluginV1Adapter) RenderTerraformComponent ¶
func (p *PluginV1Adapter) RenderTerraformComponent(site string, component string) (*schemav2.ComponentSchema, error)
func (*PluginV1Adapter) RenderTerraformProviders ¶
func (p *PluginV1Adapter) RenderTerraformProviders(site string) (string, error)
func (*PluginV1Adapter) RenderTerraformResources ¶
func (p *PluginV1Adapter) RenderTerraformResources(site string) (string, error)
func (*PluginV1Adapter) SetComponentConfig ¶
func (*PluginV1Adapter) SetComponentEndpointsConfig ¶
func (p *PluginV1Adapter) SetComponentEndpointsConfig(component string, data map[string]string) error
func (*PluginV1Adapter) SetGlobalConfig ¶
func (p *PluginV1Adapter) SetGlobalConfig(data map[string]any) error
func (*PluginV1Adapter) SetSiteComponentConfig ¶
func (*PluginV1Adapter) SetSiteConfig ¶
func (p *PluginV1Adapter) SetSiteConfig(site string, data map[string]any) error