config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvTestgroundHomeDir = "TESTGROUND_HOME"

	// DefaultListenAddr is a host:port value, where we set up an HTTP endpoint.
	// In the future we will support an HTTPS mode.
	DefaultListenAddr = "localhost:8042"

	// DefaultClientURL is the HTTP(S) endpoint of the server.
	DefaultClientURL = "http://" + DefaultListenAddr

	DefaultInfluxDBEndpoint = "http://localhost:8086"

	DefaultTaskRepoType = "memory"

	DefaultWorkers = 2

	DefaultQueueSize = 100
)
View Source
const RunnerDisabledFlag = "disabled"

Indicates whether a runner is disabled

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig

type AWSConfig struct {
	AccessKeyID     string `toml:"access_key_id"`
	SecretAccessKey string `toml:"secret_access_key"`
	Region          string `toml:"region"`
}

type ClientConfig

type ClientConfig struct {
	Endpoint string `toml:"endpoint"`
	Token    string `toml:"token"`
	User     string `toml:"user"`
}

type CoalescedConfig

type CoalescedConfig []map[string]interface{}

func (CoalescedConfig) Append

func (c CoalescedConfig) Append(in map[string]interface{}) CoalescedConfig

func (CoalescedConfig) CoalesceIntoType

func (c CoalescedConfig) CoalesceIntoType(typ reflect.Type) (interface{}, error)

type ConfigMap

type ConfigMap map[string]interface{}

type DaemonConfig

type DaemonConfig struct {
	Listen                string          `toml:"listen"`
	Scheduler             SchedulerConfig `toml:"scheduler"`
	Tokens                []string        `toml:"tokens"`
	SlackWebhookURL       string          `toml:"slack_webhook_url"`
	GithubRepoStatusToken string          `toml:"github_repo_status_token"`
	RootURL               string          `toml:"root_url"`
	InfluxDBEndpoint      string          `toml:"influxdb_endpoint"`
}

type Directories

type Directories struct {
	// contains filtered or unexported fields
}

func (Directories) Daemon added in v0.6.0

func (d Directories) Daemon() string

func (Directories) Home

func (d Directories) Home() string

func (Directories) Outputs

func (d Directories) Outputs() string

func (Directories) Plans

func (d Directories) Plans() string

func (Directories) SDKs

func (d Directories) SDKs() string

func (Directories) Work

func (d Directories) Work() string

type DockerHubConfig

type DockerHubConfig struct {
	Repo        string `toml:"repo"`
	Username    string `toml:"username"`
	AccessToken string `toml:"access_token"`
}

type EnvConfig

type EnvConfig struct {
	AWS       AWSConfig            `toml:"aws"`
	DockerHub DockerHubConfig      `toml:"dockerhub"`
	Builders  map[string]ConfigMap `toml:"builders"`
	Runners   map[string]ConfigMap `toml:"runners"`
	Daemon    DaemonConfig         `toml:"daemon"`
	Client    ClientConfig         `toml:"client"`
	// contains filtered or unexported fields
}

EnvConfig contains the environment configuration. It is populated by coalescing values from these sources, in descending order of precedence:

  1. environment variables.
  2. env.toml.
  3. default fallbacks.

func (EnvConfig) Dirs

func (e EnvConfig) Dirs() Directories

func (*EnvConfig) EnsureMinimalConfig added in v0.6.0

func (e *EnvConfig) EnsureMinimalConfig() error

func (*EnvConfig) Load

func (e *EnvConfig) Load() error

type SchedulerConfig added in v0.6.0

type SchedulerConfig struct {
	Workers        int    `toml:"workers"`
	QueueSize      int    `toml:"queue_size"`
	TaskRepoType   string `toml:"task_repo_type"`
	TaskTimeoutMin int    `toml:"task_timeout_min"`
}

Jump to

Keyboard shortcuts

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