Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDefinitionNotFound = errors.New("Definition file not found")
Functions ¶
This section is empty.
Types ¶
type Definition ¶
type Definition struct { Name string `json:"name"` Requirements []string `json:"requirements"` Configuration *jsonschema.RootSchema `json:"configuration"` }
Definition defines the plugin.yml file that each plugin has
func LoadDefinitionFromDir ¶
func LoadDefinitionFromDir(dir string) (*Definition, error)
LoadDefinitionFromDir looks in a directory for either a plugin.json or a plugin.yml
func ParseDefinition ¶
func ParseDefinition(b []byte) (*Definition, error)
ParseDefinition parses either yaml or json bytes into a Definition
type Plugin ¶
type Plugin struct { // Where the plugin can be found (can either be a file system path, or // a git repository) Location string // The version of the plugin that should be running Version string // The clone method Scheme string // Any authentication attached to the repostiory Authentication string // Configuration for the plugin Configuration map[string]interface{} }
func CreateFromJSON ¶
Given a JSON structure, convert it to an array of plugins
func CreatePlugin ¶
func (*Plugin) ConfigurationToEnvironment ¶
func (p *Plugin) ConfigurationToEnvironment() (*env.Environment, error)
Converts the plugin configuration values to environment variables
func (*Plugin) Identifier ¶
Returns and ID for the plugin that can be used as a folder name
func (*Plugin) Repository ¶
Returns the repository host where the code is stored
func (*Plugin) RepositorySubdirectory ¶
Returns the subdirectory path that the plugin is in
type ValidateResult ¶
type ValidateResult struct {
Errors []string
}
func (ValidateResult) Error ¶
func (vr ValidateResult) Error() string
func (ValidateResult) Valid ¶
func (vr ValidateResult) Valid() bool
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func (Validator) Validate ¶
func (v Validator) Validate(def *Definition, config map[string]interface{}) ValidateResult
Click to show internal directories.
Click to hide internal directories.