gwconfig

package
v51.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MPL-2.0 Imports: 10 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
	// contains filtered or unexported fields
}

Generic Worker config

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) String

func (c *Config) String() string

func (*Config) UpdateCredentials

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

func (*Config) Validate

func (c *Config) Validate() error

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) 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"`
}

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. This is implemented by gwconfig.File for configuring generic-worker from a local file.

type PublicConfig

type PublicConfig struct {
	PublicEngineConfig
	AvailabilityZone               string                 `json:"availabilityZone"`
	CachesDir                      string                 `json:"cachesDir"`
	CheckForNewDeploymentEverySecs uint                   `json:"checkForNewDeploymentEverySecs"`
	CleanUpTaskDirs                bool                   `json:"cleanUpTaskDirs"`
	ClientID                       string                 `json:"clientId"`
	CreateObjectArtifacts          bool                   `json:"createObjectArtifacts"`
	DeploymentID                   string                 `json:"deploymentId"`
	DisableReboots                 bool                   `json:"disableReboots"`
	DownloadsDir                   string                 `json:"downloadsDir"`
	Ed25519SigningKeyLocation      string                 `json:"ed25519SigningKeyLocation"`
	EnableInteractive              bool                   `json:"enableInteractive"`
	IdleTimeoutSecs                uint                   `json:"idleTimeoutSecs"`
	InstanceID                     string                 `json:"instanceId"`
	InstanceType                   string                 `json:"instanceType"`
	InteractivePort                uint16                 `json:"interactivePort"`
	LiveLogExecutable              string                 `json:"livelogExecutable"`
	LiveLogPortBase                uint16                 `json:"livelogPortBase"`
	NumberOfTasksToRun             uint                   `json:"numberOfTasksToRun"`
	PrivateIP                      net.IP                 `json:"privateIP"`
	ProvisionerID                  string                 `json:"provisionerId"`
	PublicIP                       net.IP                 `json:"publicIP"`
	Region                         string                 `json:"region"`
	RequiredDiskSpaceMegabytes     uint                   `json:"requiredDiskSpaceMegabytes"`
	RootURL                        string                 `json:"rootURL"`
	RunAfterUserCreation           string                 `json:"runAfterUserCreation"`
	SentryProject                  string                 `json:"sentryProject"`
	ShutdownMachineOnIdle          bool                   `json:"shutdownMachineOnIdle"`
	ShutdownMachineOnInternalError bool                   `json:"shutdownMachineOnInternalError"`
	TaskclusterProxyExecutable     string                 `json:"taskclusterProxyExecutable"`
	TaskclusterProxyPort           uint16                 `json:"taskclusterProxyPort"`
	TasksDir                       string                 `json:"tasksDir"`
	WorkerGroup                    string                 `json:"workerGroup"`
	WorkerID                       string                 `json:"workerId"`
	WorkerLocation                 string                 `json:"workerLocation,omitempty"`
	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