Documentation ¶
Index ¶
- type LoggingConfig
- type ProviderConfig
- type ProviderWorkerConfig
- type RunnerConfig
- type WorkerConfig
- func (wc *WorkerConfig) Get(key string) (interface{}, error)
- func (wc *WorkerConfig) Has(key string) bool
- func (wc *WorkerConfig) MarshalJSON() ([]byte, error)
- func (wc *WorkerConfig) MarshalYAML() ([]byte, error)
- func (wc *WorkerConfig) Merge(other *WorkerConfig) *WorkerConfig
- func (wc *WorkerConfig) MustGet(key string) interface{}
- func (wc *WorkerConfig) Set(key string, value interface{}) (*WorkerConfig, error)
- func (wc *WorkerConfig) UnmarshalJSON(b []byte) error
- func (wc *WorkerConfig) UnmarshalYAML(node *yaml.Node) error
- type WorkerImplementationConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoggingConfig ¶
The configuration for logging. This must at least have "implementation", plus any additional provider-specific properties.
func (*LoggingConfig) UnmarshalYAML ¶
func (lc *LoggingConfig) UnmarshalYAML(node *yaml.Node) error
type ProviderConfig ¶
The configuration for a provider. This must at least have "providerType", plus any additional provider-specific properties.
func (*ProviderConfig) UnmarshalYAML ¶
func (pc *ProviderConfig) UnmarshalYAML(node *yaml.Node) error
func (*ProviderConfig) Unpack ¶
func (pc *ProviderConfig) Unpack(out interface{}) error
Unpack this ProviderConfig to a provider's configuration struct. This will produce an error for any missing properties. Note that recursion is not supported.
Structs should be tagged with `provider:"name"`, with the name defaulting to the lowercased version of the field name.
type ProviderWorkerConfig ¶
type ProviderWorkerConfig struct { Config *WorkerConfig `json:"config,omitempty"` Files []files.File `json:"files,omitempty"` }
ProviderWorkerConfig handles the configuration format provided from worker-manager providers: `{<workerName>: {config, files}}`, including some compatibility translations described in the README.
func ParseProviderWorkerConfig ¶
func ParseProviderWorkerConfig(runnercfg *RunnerConfig, body *json.RawMessage) (ProviderWorkerConfig, error)
ParseProviderWorkerConfig takes a RawMessage representing the `workerConfig` field received from worker-manager, and returns the config and files it contains. This requires the runnerConfig in order to determine the worker implementation name.
type RunnerConfig ¶
type RunnerConfig struct { Provider ProviderConfig `yaml:"provider"` WorkerImplementation WorkerImplementationConfig `yaml:"worker"` WorkerConfig *WorkerConfig `yaml:"workerConfig"` Logging *LoggingConfig `yaml:"logging"` GetSecrets bool `yaml:"getSecrets"` CacheOverRestarts string `yaml:"cacheOverRestarts"` }
RunnerConfig defines the configuration for taskcluster-worker-starter. See the usage string for field descriptions
func LoadRunnerConfig ¶
func LoadRunnerConfig(filename string) (*RunnerConfig, error)
Load a configuration file
type WorkerConfig ¶
type WorkerConfig struct {
// contains filtered or unexported fields
}
The configuration that will be passed directly to the worker. At the top level, this is a JSON object, but it can contain arbitrary other JSON types within it.
Treat this as a read-only data structure, replacing it as necessary using the methods provided below.
func NewWorkerConfig ¶
func NewWorkerConfig() *WorkerConfig
func (*WorkerConfig) Get ¶
func (wc *WorkerConfig) Get(key string) (interface{}, error)
Get a value at the given dotted path
func (*WorkerConfig) Has ¶
func (wc *WorkerConfig) Has(key string) bool
Return true if the property is present
func (*WorkerConfig) MarshalJSON ¶
func (wc *WorkerConfig) MarshalJSON() ([]byte, error)
func (*WorkerConfig) MarshalYAML ¶
func (wc *WorkerConfig) MarshalYAML() ([]byte, error)
func (*WorkerConfig) Merge ¶
func (wc *WorkerConfig) Merge(other *WorkerConfig) *WorkerConfig
Merge two WorkerConfig objects, preferring values from the second object where both are provided. Where both objects have an object as a value, those objects are merged recursively. Where both objects have an array as a value, those arrays are concatenated.
This returns a new WorkerConfig without modifying either input.
func (*WorkerConfig) MustGet ¶
func (wc *WorkerConfig) MustGet(key string) interface{}
Like Get, but panic on error (for tests)
func (*WorkerConfig) Set ¶
func (wc *WorkerConfig) Set(key string, value interface{}) (*WorkerConfig, error)
Set a value at the given dotted path.
This returns a new WorkerConfig containing the updated value.
func (*WorkerConfig) UnmarshalJSON ¶
func (wc *WorkerConfig) UnmarshalJSON(b []byte) error
func (*WorkerConfig) UnmarshalYAML ¶
func (wc *WorkerConfig) UnmarshalYAML(node *yaml.Node) error
type WorkerImplementationConfig ¶
The configuration for a worker implementation. This must at least have "implementation", plus any additional worker implementation-specific properties.
func (*WorkerImplementationConfig) UnmarshalYAML ¶
func (pc *WorkerImplementationConfig) UnmarshalYAML(node *yaml.Node) error
func (*WorkerImplementationConfig) Unpack ¶
func (pc *WorkerImplementationConfig) Unpack(out interface{}) error
Unpack this WorkerImplementationConfig to a worker implementation's configuration struct. This will produce an error for any missing properties. Note that recursion is not supported.
Structs should be tagged with `workerimpl:"name"`, with the name defaulting to the lowercased version of the field name.