config

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilterTypeBlock    = "FILTER_TYPE_BLOCK"
	FilterTypeDocument = "FILTER_TYPE_DOCUMENT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Dir- or git-based project fields.
	DisableGitignore bool
	IgnorePaths      []string
	FindRepoUpward   bool
	ProjectDir       string

	// Filemode fields.
	Filename string

	// Environment variable fields.
	EnvSourceFiles []string
	UseSystemEnv   bool

	Filters []*Filter

	// Log related fields.
	LogEnabled bool
	LogPath    string
	LogVerbose bool

	// Server related fields.
	ServerAddress     string
	ServerTLSEnabled  bool
	ServerTLSCertFile string
	ServerTLSKeyFile  string

	// Kernel related fields.
	Kernels []Kernel
}

Config is a flatten configuration of runme.yaml. The purpose of it is to unify all the different configuration versions into a single struct.

func ParseYAML

func ParseYAML(data []byte) (*Config, error)

type DockerKernel added in v3.2.7

type DockerKernel struct {
	Build struct {
		Context    string
		Dockerfile string
	}
	Image string
	Name  string
}

func (*DockerKernel) GetName added in v3.2.7

func (k *DockerKernel) GetName() string

type Filter

type Filter struct {
	Type      string
	Condition string
	Extra     map[string]interface{}
}

func (*Filter) Evaluate

func (f *Filter) Evaluate(env interface{}) (bool, error)

type FilterBlockEnv

type FilterBlockEnv struct {
	Background             bool     `expr:"background"`
	Categories             []string `expr:"categories"`
	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"`
}

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

type FilterDocumentEnv struct {
	Cwd   string `expr:"cwd"`
	Shell string `expr:"shell"`
}

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 Kernel added in v3.2.7

type Kernel interface {
	GetName() string
}

type LocalKernel added in v3.2.7

type LocalKernel struct {
	// TODO(adamb): move config to LocalKernel
	// UseSystemEnv bool
	// EnvSources   []string
	Name string
}

func (*LocalKernel) GetName added in v3.2.7

func (k *LocalKernel) GetName() string

Directories

Path Synopsis
autoconfig provides a way to create various instances from the [config.Config] like [project.Project], [command.Session], [zap.Logger].
autoconfig provides a way to create various instances from the [config.Config] like [project.Project], [command.Session], [zap.Logger].

Jump to

Keyboard shortcuts

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