gwconfig

package
v16.6.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PrivateConfig
	PublicConfig
}

Generic Worker config

func (*Config) AWSProvisioner

func (c *Config) AWSProvisioner() *tcawsprovisioner.AwsProvisioner

func (*Config) Auth

func (c *Config) Auth() *tcauth.Auth

func (*Config) Credentials

func (c *Config) Credentials() *tcclient.Credentials

func (*Config) MergeInJSON

func (c *Config) MergeInJSON(data json.RawMessage, extract func(map[string]interface{}) map[string]interface{}) error

MergeInJSON merges config embedded inside a json.RawMessage into c.

It does this by converting c to a map[string]interface, convering data to a map[string]interface and calling extract against the result to return a map[string]interface for its config portion, then merging the two map[string]interfaces together and unmarshaling back into c.

func (*Config) PurgeCache

func (c *Config) PurgeCache() *tcpurgecache.PurgeCache

func (*Config) Queue

func (c *Config) Queue() *tcqueue.Queue

func (*Config) Secrets

func (c *Config) Secrets() *tcsecrets.Secrets

func (*Config) String

func (c *Config) String() string

func (*Config) Validate

func (c *Config) Validate() error

func (*Config) WorkerManager

func (c *Config) WorkerManager() *tcworkermanager.WorkerManager

type File

type File struct {
	Path string
}

func (*File) DoesNotExist

func (cf *File) DoesNotExist() bool

func (*File) NewestDeploymentID

func (cf *File) NewestDeploymentID() (string, error)

func (*File) Persist

func (cf *File) Persist(c *Config) error

Persist writes config to json file

func (*File) UpdateConfig

func (cf *File) UpdateConfig(c *Config) error

type MissingConfigError

type MissingConfigError struct {
	Setting string
}

func (MissingConfigError) Error

func (err MissingConfigError) Error() string

type PrivateConfig

type PrivateConfig struct {
	AccessToken   string `json:"accessToken"`
	Certificate   string `json:"certificate"`
	LiveLogSecret string `json:"livelogSecret"`
}

type Provider

type Provider interface {
	// NewestDeploymentID fetches the latest/newest/most-recent deployment ID.
	// Depending on the provider, this may make a network request to retrieve
	// data from a taskcluster entity (such as a worker pool definition) or may
	// just look at the local generic-worker config file. See generic-worker
	// help text for information about the deploymentId property.
	NewestDeploymentID() (string, error)
	UpdateConfig(c *Config) error
}

gwconfig.Provider is an interface for configuring generic-worker. Implementors include AWSProvisioner, AWSProvider, GCPConfigProvider, and gwconfig.File for configuring generic-worker from a local file.

type PublicConfig

type PublicConfig struct {
	PublicEngineConfig
	AuthBaseURL                    string                 `json:"authBaseURL"`
	AvailabilityZone               string                 `json:"availabilityZone"`
	CachesDir                      string                 `json:"cachesDir"`
	CheckForNewDeploymentEverySecs uint                   `json:"checkForNewDeploymentEverySecs"`
	CleanUpTaskDirs                bool                   `json:"cleanUpTaskDirs"`
	ClientID                       string                 `json:"clientId"`
	DeploymentID                   string                 `json:"deploymentId"`
	DisableReboots                 bool                   `json:"disableReboots"`
	DownloadsDir                   string                 `json:"downloadsDir"`
	Ed25519SigningKeyLocation      string                 `json:"ed25519SigningKeyLocation"`
	IdleTimeoutSecs                uint                   `json:"idleTimeoutSecs"`
	InstanceID                     string                 `json:"instanceId"`
	InstanceType                   string                 `json:"instanceType"`
	LiveLogCertificate             string                 `json:"livelogCertificate"`
	LiveLogExecutable              string                 `json:"livelogExecutable"`
	LiveLogGETPort                 uint16                 `json:"livelogGETPort"`
	LiveLogKey                     string                 `json:"livelogKey"`
	LiveLogPUTPort                 uint16                 `json:"livelogPUTPort"`
	NumberOfTasksToRun             uint                   `json:"numberOfTasksToRun"`
	PrivateIP                      net.IP                 `json:"privateIP"`
	ProvisionerBaseURL             string                 `json:"provisionerBaseURL"`
	ProvisionerID                  string                 `json:"provisionerId"`
	PublicIP                       net.IP                 `json:"publicIP"`
	PurgeCacheBaseURL              string                 `json:"purgeCacheBaseURL"`
	QueueBaseURL                   string                 `json:"queueBaseURL"`
	Region                         string                 `json:"region"`
	RequiredDiskSpaceMegabytes     uint                   `json:"requiredDiskSpaceMegabytes"`
	RootURL                        string                 `json:"rootURL"`
	RunAfterUserCreation           string                 `json:"runAfterUserCreation"`
	SecretsBaseURL                 string                 `json:"secretsBaseURL"`
	SentryProject                  string                 `json:"sentryProject"`
	ShutdownMachineOnIdle          bool                   `json:"shutdownMachineOnIdle"`
	ShutdownMachineOnInternalError bool                   `json:"shutdownMachineOnInternalError"`
	Subdomain                      string                 `json:"subdomain"`
	TaskclusterProxyExecutable     string                 `json:"taskclusterProxyExecutable"`
	TaskclusterProxyPort           uint16                 `json:"taskclusterProxyPort"`
	TasksDir                       string                 `json:"tasksDir"`
	WorkerGroup                    string                 `json:"workerGroup"`
	WorkerID                       string                 `json:"workerId"`
	WorkerLocation                 string                 `json:"workerLocation"`
	WorkerManagerBaseURL           string                 `json:"workerManagerBaseURL"`
	WorkerType                     string                 `json:"workerType"`
	WorkerTypeMetadata             map[string]interface{} `json:"workerTypeMetadata"`
	WSTAudience                    string                 `json:"wstAudience"`
	WSTServerURL                   string                 `json:"wstServerURL"`
}

Jump to

Keyboard shortcuts

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