Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { Plugin Plugin // contains filtered or unexported fields }
func NewContainer ¶
func (*Container) ValidateSpec ¶
func (pc *Container) ValidateSpec(pluginSpec map[string]interface{}) (ValidationResult, error)
type Context ¶ added in v1.0.0
type Context struct { // Namespace is the namespace where the returned object will be created. Namespace string // Actual is the actual object that will be updated if it exists already. // nil if the object does not exist. Actual runtime.Object // Dependencies is the map from dependency name to a description of that dependency. Dependencies map[smith_v1.ResourceName]Dependency }
Context contains contextual information for the Process() call.
type Dependency ¶
type Dependency struct { // Spec is the specification of the resource as specified in the Bundle. Spec smith_v1.Resource // Actual is the actual dependency object. Actual runtime.Object // Outputs are objects produced by the actual object. Outputs []runtime.Object // Auxiliary are objects that somehow relate to the actual object. Auxiliary []runtime.Object }
Dependency contains information about a dependency of a resource that a plugin is processing.
type Description ¶ added in v1.0.0
type Description struct { Name smith_v1.PluginName GVK schema.GroupVersionKind // gojsonschema supported schema for the spec (first argument of Process) SpecSchema []byte }
type NewFunc ¶ added in v1.0.0
NewFunc is a factory function that returns an initialized plugin. Called once on Smith startup.
type Plugin ¶ added in v1.0.0
type Plugin interface { // Describe returns information about the plugin. Describe() *Description // Process processes a plugin specification and produces an object as the result. Process(map[string]interface{}, *Context) ProcessResult }
Plugin represents a plugin and the functionality it provides.
type ProcessResult ¶
type ProcessResult interface {
StatusType() ProcessResultType
}
ProcessResult contains result of the Process() call.
type ProcessResultFailure ¶
func (*ProcessResultFailure) StatusType ¶
func (r *ProcessResultFailure) StatusType() ProcessResultType
type ProcessResultSuccess ¶
type ProcessResultSuccess struct { // Object is the object that should be created/updated. Object runtime.Object }
func (*ProcessResultSuccess) StatusType ¶
func (r *ProcessResultSuccess) StatusType() ProcessResultType
type ProcessResultType ¶
type ProcessResultType string
const ( ProcessResultSuccessType ProcessResultType = "Success" ProcessResultFailureType ProcessResultType = "Failure" )
type ValidationResult ¶
type ValidationResult struct {
Errors []error
}
Click to show internal directories.
Click to hide internal directories.