Documentation
¶
Index ¶
- Constants
- type Action
- type BundleConnection
- type BundleOutput
- type Config
- func (c *Config) GetBundleDir(bundle string) (string, error)
- func (c *Config) GetBundleManifestPath(bundle string) (string, error)
- func (c *Config) GetBundlesCache() (string, error)
- func (c *Config) GetHomeDir() (string, error)
- func (c *Config) GetMixinDir(mixin string) (string, error)
- func (c *Config) GetMixinPath(mixin string) (string, error)
- func (c *Config) GetMixinRuntimePath(mixin string) (string, error)
- func (c *Config) GetMixinsDir() (string, error)
- func (c *Config) GetPorterConfigTemplate() ([]byte, error)
- func (c *Config) GetRunScriptTemplate() ([]byte, error)
- func (c *Config) GetTemplatesDir() (string, error)
- func (c *Config) LoadDependencies() error
- func (c *Config) LoadManifest() error
- func (c *Config) LoadManifestFrom(file string) error
- func (c *Config) ReadManifest(path string) (*Manifest, error)
- type CredentialDefinition
- type Dependency
- type Location
- type Manifest
- func (m *Manifest) ApplyOutputs(step *Step, assignments []string) error
- func (m *Manifest) GetManifestDir() string
- func (m *Manifest) GetSteps(action Action) (Steps, error)
- func (m *Manifest) Map(val reflect.Value) error
- func (m *Manifest) MapElem(mp, k, v reflect.Value) error
- func (m *Manifest) MergeDependency(dep *Dependency) error
- func (m *Manifest) MergeInstall(dep *Dependency)
- func (m *Manifest) MergeParameters(dep *Dependency) error
- func (m *Manifest) MergeUninstall(dep *Dependency)
- func (m *Manifest) ResolveStep(step *Step) error
- func (m *Manifest) Slice(val reflect.Value) error
- func (m *Manifest) SliceElem(index int, val reflect.Value) error
- func (m *Manifest) Struct(val reflect.Value) error
- func (m *Manifest) StructField(field reflect.StructField, val reflect.Value) error
- func (m *Manifest) Validate() error
- type ParameterDefinition
- type ParameterMetadata
- type Step
- type StepOutput
- type Steps
- type TestConfig
Constants ¶
const ( // Name is the file name of the porter configuration file. Name = "porter.yaml" // RunScript is the path to the CNAB run script. RunScript = "cnab/app/run" // EnvHOME is the name of the environment variable containing the porter home directory path. EnvHOME = "PORTER_HOME" // EnvACTION is the request EnvACTION = "CNAB_ACTION" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BundleConnection ¶
type BundleOutput ¶
type Config ¶
func (*Config) GetBundleDir ¶
GetBundleDir locates a bundle Lookup order: - ./bundles/ - PORTER_HOME/bundles/
func (*Config) GetBundleManifestPath ¶
GetBundleManifest gets the path to another bundle's manifest.
func (*Config) GetBundlesCache ¶
GetBundlesDir locates the bundle cache from the porter home directory.
func (*Config) GetHomeDir ¶
GetHomeDir determines the path to the porter home directory.
func (*Config) GetMixinRuntimePath ¶
func (*Config) GetMixinsDir ¶
func (*Config) GetPorterConfigTemplate ¶
GetPorterConfigTemplate reads templates/porter.yaml from the porter home directory.
func (*Config) GetRunScriptTemplate ¶
GetRunScriptTemplate reads templates/run from the porter home directory.
func (*Config) GetTemplatesDir ¶
GetTemplatesDir determines the path to the templates directory.
func (*Config) LoadDependencies ¶
func (*Config) LoadManifest ¶
func (*Config) LoadManifestFrom ¶
type CredentialDefinition ¶
type Dependency ¶
type Dependency struct { Name string `yaml:"name"` Parameters map[string]string `yaml:"parameters,omitempty"` Connections []BundleConnection `yaml:"connections",omitempty` // contains filtered or unexported fields }
func (*Dependency) Validate ¶
func (d *Dependency) Validate() error
type Manifest ¶
type Manifest struct { Name string `yaml:"image,omitempty"` Version string `yaml:"version,omitempty"` Image string `yaml:"invocationImage,omitempty"` Mixins []string `yaml:"mixins,omitempty"` Install Steps `yaml:"install"` Uninstall Steps `yaml:"uninstall"` Parameters []ParameterDefinition `yaml:"parameters,omitempty"` Credentials []CredentialDefinition `yaml:"credentials,omitempty"` Dependencies []*Dependency `yaml:"dependencies,omitempty"` // contains filtered or unexported fields }
func (*Manifest) ApplyOutputs ¶
func (*Manifest) GetManifestDir ¶
GetManifestDir returns the path to the directory that contains the manifest.
func (*Manifest) Map ¶
Map is a NOOP but implements the github.com/mitchellh/reflectwalk MapWalker interface
func (*Manifest) MapElem ¶
MapElem implements the github.com/mitchellh/reflectwalk MapWalker interface and handles individual map elements. It will resolve source references to their value within a porter bundle and replace the value
func (*Manifest) MergeDependency ¶
func (m *Manifest) MergeDependency(dep *Dependency) error
func (*Manifest) MergeInstall ¶
func (m *Manifest) MergeInstall(dep *Dependency)
func (*Manifest) MergeParameters ¶
func (m *Manifest) MergeParameters(dep *Dependency) error
func (*Manifest) MergeUninstall ¶
func (m *Manifest) MergeUninstall(dep *Dependency)
func (*Manifest) ResolveStep ¶
ResolveStep will walk through the Step's data and resolve any placeholder data using the definitions in the manifest, like parameters or credentials.
func (*Manifest) Slice ¶
Slice is a NOOP but implements the github.com/mitchellh/reflectwalk SliceWalker interface
func (*Manifest) SliceElem ¶
SliceElem implements the github.com/mitchellh/reflectwalk SliceWalker interface and handles individual slice elements. It will resolve source references to their value within a porter bundle and replace the value
func (*Manifest) Struct ¶
Struct implements reflectwalk's StructWalker so that we can skip private fields
func (*Manifest) StructField ¶
Struct implements reflectwalk's StructWalker so that we can skip private fields
type ParameterDefinition ¶
type ParameterDefinition struct { Name string `yaml:"name"` DataType string `yaml:"type"` DefaultValue interface{} `yaml:"default,omitempty"` AllowedValues []interface{} `yaml:"allowed,omitempty"` Required bool `yaml:"required"` MinValue *int `yaml:"minValue,omitempty"` MaxValue *int `yaml:"maxValue,omitempty"` MinLength *int `yaml:"minLength,omitempty"` MaxLength *int `yaml:"maxLength,omitempty"` Metadata ParameterMetadata `yaml:"metadata,omitempty"` Destination *Location `yaml:"destination,omitempty"` }
ParameterDefinition defines a single parameter for a CNAB bundle
type ParameterMetadata ¶
type ParameterMetadata struct {
Description string `yaml:"description,omitempty"`
}
ParameterMetadata contains metadata for a parameter definition.
type Step ¶
type Step struct { Description string `yaml:"description"` Outputs []StepOutput `yaml:"outputs"` Data map[string]interface{} `yaml:",inline"` // contains filtered or unexported fields }
func (*Step) GetMixinName ¶
type StepOutput ¶
type TestConfig ¶
type TestConfig struct { *Config TestContext *context.TestContext }
func NewTestConfig ¶
func NewTestConfig(t *testing.T) *TestConfig
NewTestConfig initializes a configuration suitable for testing, with the output buffered, and an in-memory file system.
func (*TestConfig) SetupPorterHome ¶
func (c *TestConfig) SetupPorterHome()
InitializePorterHome initializes the test filesystem with the supporting files in the PORTER_HOME directory.