Documentation ¶
Index ¶
- Constants
- func LoadConfigFile(dataStruct interface{}, meta *Metadata, configFilePath string) error
- func SaveConfigFile(data interface{}, configFilePath string) error
- func SaveDependenciesIndex(config *DependenciesIndex) error
- func SaveProjectConfig(config *ProjectConfig) error
- type CommandConfig
- type DependenciesIndex
- type DependenciesIndexEntry
- type Dependency
- type GenericConfigFile
- type Metadata
- type PluginConfig
- type ProjectConfig
- type Registry
- type RegistryEntry
- type RegistryEntryVersion
Constants ¶
const CommandConfigKind string = "Command"
CommandConfigKind defines kind property value of for klio.yaml files.
Variables ¶
This section is empty.
Functions ¶
func LoadConfigFile ¶
LoadConfigFile reads, parses and validates specified configuration file.
func SaveConfigFile ¶
SaveConfigFile validates, serializes and saves configuration to a file.
func SaveDependenciesIndex ¶
func SaveDependenciesIndex(config *DependenciesIndex) error
SaveDependenciesIndex saves a dependenceis index file.
func SaveProjectConfig ¶
func SaveProjectConfig(config *ProjectConfig) error
SaveProjectConfig saves a project configuration file.
Types ¶
type CommandConfig ¶
type CommandConfig struct { // Meta stores metadata of the config file (such as a path). Meta Metadata `yaml:"-"` // APIVersion can be used to handle more than one config file format APIVersion string `yaml:"apiVersion,omitempty"` // Kind of the config file Kind string `yaml:"kind,omitempty" validate:"eq=Command"` // Name of the command. BinPath string `yaml:"binPath,omitempty" validate:"required,file"` // Description of the command used by core "klio" binary in order to show usage. Description string `yaml:"description,omitempty"` }
CommandConfig describes structure of klio.yaml files.
func LoadCommandConfig ¶
func LoadCommandConfig(filePath string) (*CommandConfig, error)
LoadCommandConfig reads a project configuration file.
type DependenciesIndex ¶
type DependenciesIndex struct { Meta Metadata `json:"-"` APIVersion string `json:"apiVersion,omitempty"` Kind string `json:"kind,omitempty"` Entries []DependenciesIndexEntry `json:"entries"` }
func LoadDependenciesIndex ¶
func LoadDependenciesIndex(filePath string) (*DependenciesIndex, error)
LoadDependenciesIndex reads a dependenceis index file.
type DependenciesIndexEntry ¶
type Dependency ¶
type Dependency struct { Name string `yaml:"name,omitempty"` Registry string `yaml:"registry,omitempty"` Version string `yaml:"version"` Alias string `yaml:"-"` }
Dependency describes project's dependency - command or plugin.
type GenericConfigFile ¶
type PluginConfig ¶
type PluginConfig struct { // Meta stores metadata of the config file (such as a path). Meta Metadata `yaml:"-"` // APIVersion can be used to handle more than one config file format APIVersion string `yaml:"apiVersion,omitempty"` // Kind of the config file Kind string `yaml:"kind,omitempty" validate:"eq=Command"` // Name of the command. BinPath string `yaml:"binPath,omitempty" validate:"required,file"` // Description of the command used by core "klio" binary in order to show usage. Description string `yaml:"description,omitempty"` }
PluginConfig describes structure of klio.yaml files.
type ProjectConfig ¶
type ProjectConfig struct { Meta Metadata DefaultRegistry string Dependencies []Dependency // contains filtered or unexported fields }
ProjectConfig describes structure of klio.yaml files.
func CreateDefaultProjectConfig ¶
func CreateDefaultProjectConfig(filePath string) (*ProjectConfig, error)
CreateDefaultProjectConfig creates default ProjectConfig and save it to give path if it's not already there.
func LoadProjectConfig ¶
func LoadProjectConfig(filePath string) (*ProjectConfig, error)
LoadProjectConfig reads a project configuration file.
func NewDefaultProjectConfig ¶
func NewDefaultProjectConfig() *ProjectConfig
func (ProjectConfig) MarshalYAML ¶
func (p ProjectConfig) MarshalYAML() (interface{}, error)
func (*ProjectConfig) UnmarshalYAML ¶
func (p *ProjectConfig) UnmarshalYAML(node *yaml.Node) error