Documentation
¶
Index ¶
- Variables
- func GetPluginFileName(t *Tool) string
- func GetPluginMD5FileName(t *Tool) string
- func GetPluginName(t *Tool) string
- func SplitConfigFileBytes(fileBytes []byte) (coreConfig []byte, varConfig []byte, toolConfig []byte, err error)
- type Config
- type CoreConfig
- type State
- type StateConfigOptions
- type Tool
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetPluginFileName ¶
GetPluginFileName creates the file name based on the tool's name and version If the plugin {githubactions 0.0.1}, the generated name will be "githubactions_0.0.1.so"
func GetPluginMD5FileName ¶
GetPluginMD5FileName If the plugin {githubactions 0.0.1}, the generated name will be "githubactions_0.0.1.md5"
func GetPluginName ¶ added in v0.8.0
GetPluginName return plugin name without file extensions
func SplitConfigFileBytes ¶ added in v0.7.0
func SplitConfigFileBytes(fileBytes []byte) (coreConfig []byte, varConfig []byte, toolConfig []byte, err error)
SplitConfigFileBytes take the original config file and split it to: 1. core config 2. variables config 3. tools config Original config should be like below: --- # core config varFile: "" # If not empty, use the specified external variables config file toolFile: "" # If not empty, use the specified external tools config file state:
backend: local options: stateFile: devstream.state
--- # variables config foo: bar
--- # plugins config tools:
- name: A-PLUGIN-NAME instanceID: default options: foo: bar
See https://github.com/devstream-io/devstream/issues/596 for more details.
Types ¶
type Config ¶
Config is the struct for loading DevStream configuration YAML files. It records rendered config values and is used as a general config in DevStream.
func LoadConfig ¶ added in v0.7.0
LoadConfig reads an input file as a general config.
func (*Config) ValidateDependency ¶ added in v0.7.0
type CoreConfig ¶ added in v0.7.0
type CoreConfig struct { // TODO(daniel-hutao): Relative path support VarFile string `yaml:"varFile"` // TODO(daniel-hutao): Relative path support ToolFile string `yaml:"toolFile"` State *State `yaml:"state"` }
CoreConfig is the struct representing the complete original configuration YAML files.
func (*CoreConfig) ParseToolFilePath ¶ added in v0.7.0
func (c *CoreConfig) ParseToolFilePath() error
func (*CoreConfig) ParseVarFilePath ¶ added in v0.7.0
func (c *CoreConfig) ParseVarFilePath() error
func (*CoreConfig) Validate ¶ added in v0.7.0
func (c *CoreConfig) Validate() (bool, error)
type State ¶ added in v0.5.0
type State struct { Backend string `yaml:"backend"` Options StateConfigOptions `yaml:"options"` }
State is the struct for reading the state configuration in the config file. It defines how the state is stored, specifies the type of backend and related options.
type StateConfigOptions ¶ added in v0.6.0
type StateConfigOptions struct { // for s3 backend Bucket string `yaml:"bucket"` Region string `yaml:"region"` Key string `yaml:"key"` // for local backend StateFile string `yaml:"stateFile"` }
StateConfigOptions is the struct for reading the options of the state backend.
type Tool ¶
type Tool struct { Name string `yaml:"name" validate:"required"` // RFC 1123 - DNS Subdomain Names style // contain no more than 253 characters // contain only lowercase alphanumeric characters, '-' or '.' // start with an alphanumeric character // end with an alphanumeric character InstanceID string `yaml:"instanceID" validate:"required,dns1123subdomain"` DependsOn []string `yaml:"dependsOn"` Options map[string]interface{} `yaml:"options"` }
Tool is the struct for one section of the DevStream tool file (part of the config.)