configloader

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GOOS   string = runtime.GOOS
	GOARCH string = runtime.GOARCH
)

Functions

func GetDtmMD5FileName

func GetDtmMD5FileName() string

GetDtmMD5FileName format likes dtm-linux-amd64

func GetPluginFileName

func GetPluginFileName(t *Tool) string

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

func GetPluginMD5FileName(t *Tool) string

GetPluginMD5FileName If the plugin {githubactions 0.0.1}, the generated name will be "githubactions_0.0.1.md5"

Types

type Config

type Config struct {
	Tools []Tool `yaml:"tools"`
	State *State
}

Config is the struct for loading DevStream configuration YAML files.

func LoadConf

func LoadConf(configFileName string) (*Config, error)

LoadConf reads an input file as a general config.

func LoadToolConf added in v0.5.0

func LoadToolConf(toolFileName, varFileName string) (*Config, error)

LoadToolConf reads tool file rendering by var file as a Config struct.

type ConfigFile added in v0.5.0

type ConfigFile struct {
	VarFile  string `yaml:"varFile"`
	ToolFile string `yaml:"toolFile"`
	State    *State `yaml:"state"`
}

ConfigFile is the struct for loading State and configuration YAML files.

type State added in v0.5.0

type State struct {
	Backend string             `yaml:"backend"`
	Options StateConfigOptions `yaml:"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"`
}

type Tool

type Tool struct {
	Name string `yaml:"name"`
	// 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"`
	DependsOn  []string               `yaml:"dependsOn"`
	Options    map[string]interface{} `yaml:"options"`
}

Tool is the struct for one section of the DevStream configuration file.

func (*Tool) DeepCopy

func (t *Tool) DeepCopy() *Tool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL