Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type ConfigClient
- type ConfigLog
- type ConfigProject
- type ConfigProjectEnv
- type ConfigProjectFiltersElem
- type ConfigProjectFiltersElemExtra
- type ConfigProjectFiltersElemType
- type ConfigRuntime
- type ConfigRuntimeDocker
- type ConfigRuntimeDockerBuild
- type ConfigServer
- type ConfigServerTls
- type Filter
- type FilterBlockEnv
- type FilterDocumentEnv
- type Loader
- type LoaderOption
Constants ¶
const ( FilterTypeBlock = "FILTER_TYPE_BLOCK" FilterTypeDocument = "FILTER_TYPE_DOCUMENT" )
Variables ¶
var ErrRootConfigNotFound = errors.New("root configuration file not found")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Client corresponds to the JSON schema field "client".
Client *ConfigClient `json:"client,omitempty" yaml:"client,omitempty"`
// Log corresponds to the JSON schema field "log".
Log *ConfigLog `json:"log,omitempty" yaml:"log,omitempty"`
// Project corresponds to the JSON schema field "project".
Project ConfigProject `json:"project" yaml:"project"`
// Runtime corresponds to the JSON schema field "runtime".
Runtime *ConfigRuntime `json:"runtime,omitempty" yaml:"runtime,omitempty"`
// Server corresponds to the JSON schema field "server".
Server *ConfigServer `json:"server,omitempty" yaml:"server,omitempty"`
// Version corresponds to the JSON schema field "version".
Version string `json:"version" yaml:"version"`
}
Runme configuration schema
func ParseYAML ¶
ParseYAML parses the given YAML items and returns a configuration object. Multiple items are merged into a single configuration.
func (*Config) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ConfigClient ¶
type ConfigClient struct {
// ServerAddress corresponds to the JSON schema field "server_address".
ServerAddress string `json:"server_address" yaml:"server_address"`
}
func (*ConfigClient) UnmarshalJSON ¶
func (j *ConfigClient) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ConfigLog ¶
type ConfigLog struct {
// Enabled corresponds to the JSON schema field "enabled".
Enabled bool `json:"enabled" yaml:"enabled"`
// Path corresponds to the JSON schema field "path".
Path string `json:"path" yaml:"path"`
// Verbose corresponds to the JSON schema field "verbose".
Verbose bool `json:"verbose,omitempty" yaml:"verbose,omitempty"`
}
func (*ConfigLog) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ConfigProject ¶
type ConfigProject struct {
// DisableGitignore corresponds to the JSON schema field "disable_gitignore".
DisableGitignore bool `json:"disable_gitignore,omitempty" yaml:"disable_gitignore,omitempty"`
// Env corresponds to the JSON schema field "env".
Env *ConfigProjectEnv `json:"env,omitempty" yaml:"env,omitempty"`
// Filename corresponds to the JSON schema field "filename".
Filename string `json:"filename,omitempty" yaml:"filename,omitempty"`
// Filters corresponds to the JSON schema field "filters".
Filters []ConfigProjectFiltersElem `json:"filters,omitempty" yaml:"filters,omitempty"`
// FindRepoUpward corresponds to the JSON schema field "find_repo_upward".
FindRepoUpward bool `json:"find_repo_upward,omitempty" yaml:"find_repo_upward,omitempty"`
// Ignore corresponds to the JSON schema field "ignore".
Ignore []string `json:"ignore,omitempty" yaml:"ignore,omitempty"`
// Root corresponds to the JSON schema field "root".
Root string `json:"root,omitempty" yaml:"root,omitempty"`
}
func (*ConfigProject) UnmarshalJSON ¶
func (j *ConfigProject) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ConfigProjectEnv ¶
type ConfigProjectEnv struct {
// Sources corresponds to the JSON schema field "sources".
Sources []string `json:"sources,omitempty" yaml:"sources,omitempty"`
// UseSystemEnv corresponds to the JSON schema field "use_system_env".
UseSystemEnv bool `json:"use_system_env,omitempty" yaml:"use_system_env,omitempty"`
}
func (*ConfigProjectEnv) UnmarshalJSON ¶
func (j *ConfigProjectEnv) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ConfigProjectFiltersElem ¶
type ConfigProjectFiltersElem struct {
// Condition corresponds to the JSON schema field "condition".
Condition string `json:"condition" yaml:"condition"`
// Extra corresponds to the JSON schema field "extra".
Extra ConfigProjectFiltersElemExtra `json:"extra,omitempty" yaml:"extra,omitempty"`
// Type corresponds to the JSON schema field "type".
Type ConfigProjectFiltersElemType `json:"type" yaml:"type"`
}
func (*ConfigProjectFiltersElem) UnmarshalJSON ¶
func (j *ConfigProjectFiltersElem) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ConfigProjectFiltersElemExtra ¶
type ConfigProjectFiltersElemExtra map[string]interface{}
type ConfigProjectFiltersElemType ¶
type ConfigProjectFiltersElemType string
const ( ConfigProjectFiltersElemTypeFILTERTYPEBLOCK ConfigProjectFiltersElemType = "FILTER_TYPE_BLOCK" ConfigProjectFiltersElemTypeFILTERTYPEDOCUMENT ConfigProjectFiltersElemType = "FILTER_TYPE_DOCUMENT" )
func (*ConfigProjectFiltersElemType) UnmarshalJSON ¶
func (j *ConfigProjectFiltersElemType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ConfigRuntime ¶
type ConfigRuntime struct {
// Docker corresponds to the JSON schema field "docker".
Docker *ConfigRuntimeDocker `json:"docker,omitempty" yaml:"docker,omitempty"`
}
type ConfigRuntimeDocker ¶
type ConfigRuntimeDocker struct {
// Build corresponds to the JSON schema field "build".
Build *ConfigRuntimeDockerBuild `json:"build,omitempty" yaml:"build,omitempty"`
// Enabled corresponds to the JSON schema field "enabled".
Enabled bool `json:"enabled" yaml:"enabled"`
// Image corresponds to the JSON schema field "image".
Image string `json:"image" yaml:"image"`
}
func (*ConfigRuntimeDocker) UnmarshalJSON ¶
func (j *ConfigRuntimeDocker) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ConfigRuntimeDockerBuild ¶
type ConfigRuntimeDockerBuild struct {
// Context corresponds to the JSON schema field "context".
Context string `json:"context" yaml:"context"`
// Dockerfile corresponds to the JSON schema field "dockerfile".
Dockerfile string `json:"dockerfile" yaml:"dockerfile"`
}
func (*ConfigRuntimeDockerBuild) UnmarshalJSON ¶
func (j *ConfigRuntimeDockerBuild) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ConfigServer ¶
type ConfigServer struct {
// Address corresponds to the JSON schema field "address".
Address string `json:"address" yaml:"address"`
// MaxMessageSize corresponds to the JSON schema field "max_message_size".
MaxMessageSize int `json:"max_message_size,omitempty" yaml:"max_message_size,omitempty"`
// Tls corresponds to the JSON schema field "tls".
Tls *ConfigServerTls `json:"tls,omitempty" yaml:"tls,omitempty"`
}
func (*ConfigServer) UnmarshalJSON ¶
func (j *ConfigServer) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ConfigServerTls ¶
type ConfigServerTls struct {
// CertFile corresponds to the JSON schema field "cert_file".
CertFile *string `json:"cert_file,omitempty" yaml:"cert_file,omitempty"`
// Enabled corresponds to the JSON schema field "enabled".
Enabled bool `json:"enabled" yaml:"enabled"`
// KeyFile corresponds to the JSON schema field "key_file".
KeyFile *string `json:"key_file,omitempty" yaml:"key_file,omitempty"`
}
func (*ConfigServerTls) UnmarshalJSON ¶
func (j *ConfigServerTls) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type FilterBlockEnv ¶
type FilterBlockEnv struct {
Background bool `expr:"background"`
CloseTerminalOnSuccess bool `expr:"close_terminal_on_success"`
Cwd string `expr:"cwd"`
ExcludeFromRunAll bool `expr:"exclude_from_run_all"`
Interactive bool `expr:"interactive"`
IsNamed bool `expr:"is_named"`
Language string `expr:"language"`
Name string `expr:"name"`
PromptEnv bool `expr:"prompt_env"`
Tags []string `expr:"tags"`
}
FilterBlockEnv is the environment with fields corresponding to the options documented on https://docs.runme.dev/configuration/cell-level. Cell options are converted to this environment before evaluating the filter.
The `expr` tag is used to map the field to the corresponding option. Without it, all variables start with capitalized letters.
type FilterDocumentEnv ¶
FilterDocumentEnv is the environment with fields corresponding to the options documented on https://docs.runme.dev/configuration/document-level. Document options are converted to this environment before evaluating the filter.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader allows to load configuration files from a file system.
func NewLoader ¶
func NewLoader(configNames []string, configRootPath fs.FS, opts ...LoaderOption) *Loader
func (*Loader) RootConfigs ¶
type LoaderOption ¶
type LoaderOption func(*Loader)
func WithLogger ¶
func WithLogger(logger *zap.Logger) LoaderOption
func WithProjectRootPath ¶
func WithProjectRootPath(projectRootPath fs.FS) LoaderOption
Directories
¶
| Path | Synopsis |
|---|---|
|
autoconfig provides a way to create instances of objects based on the configuration in runme.yaml.
|
autoconfig provides a way to create instances of objects based on the configuration in runme.yaml. |