Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListConfigPaths ¶
ListConfigPaths is used to list all possible config paths
func SaveConfigs ¶
SaveConfigs is used to save configs into files
Types ¶
type Config ¶
type Config struct { Scopes []string `json:"scopes" yaml:"scopes"` Protoc string `json:"protoc" yaml:"protoc"` ProtocWorkDir string `json:"protocWorkDir" yaml:"protocWorkDir"` Plugins map[string]string `json:"plugins" yaml:"plugins"` Repositories map[string]string `json:"repositories" yaml:"repositories"` Options []string `json:"options" yaml:"options"` ImportPaths []string `json:"importPaths" yaml:"importPaths"` PostActions []*PostAction `json:"postActions" yaml:"postActions"` PostShell string `json:"postShell" yaml:"postShell"` }
Config defines the config model
func LoadConfigs ¶
LoadConfigs is used to load config from specified path
type ConfigItem ¶
type ConfigItem interface { // ID is used to return to config unique id ID() string // Path is used to return the config path Path() string // Config is used to return the Config Config() *Config }
ConfigItem is the wrapper of Config
func GetConfigItems ¶
func GetConfigItems(data []*Config, path string) []ConfigItem
GetConfigItems is used to generate ConfigItem from given config entity
func LoadConfigItems ¶
func LoadConfigItems(path string) ([]ConfigItem, error)
LoadConfigItems is similar to LoadConfigs, but obtains the abstraction of the Config prototype structure
type PostAction ¶
type PostAction struct { Name string `json:"name" yaml:"name"` Args []string `json:"args" yaml:"args"` }
PostAction defines the Action model
Click to show internal directories.
Click to hide internal directories.