Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

type Bytes int64

Bytes stores number bytes (e.g. megabytes)

func (*Bytes) Decode

func (b *Bytes) Decode(value string) error

Decode implements a decoder that parses a string representation of bytes into the number of bytes it represents.

func (*Bytes) Int64

func (b *Bytes) Int64() int64

Int64 returns the int64 value of the Byte.

func (*Bytes) String

func (b *Bytes) String() string

String returns the string value of the Byte.

type Config

type Config struct {
	Docker     Docker
	Logging    Logging
	Registries Registries
	Runner     Runner
	RPC        RPC
	Server     Server
	Secrets    Secrets
}

Config provides the system configuration.

func Environ

func Environ() (Config, error)

Environ returns the settings from the environment.

type Docker

type Docker struct {
	Config string `envconfig:"DRONE_DOCKER_CONFIG"`
}

Docker provides docker configuration

type Logging

type Logging struct {
	Debug  bool `envconfig:"DRONE_LOGS_DEBUG"`
	Trace  bool `envconfig:"DRONE_LOGS_TRACE"`
	Color  bool `envconfig:"DRONE_LOGS_COLOR"`
	Pretty bool `envconfig:"DRONE_LOGS_PRETTY"`
	Text   bool `envconfig:"DRONE_LOGS_TEXT"`
}

Logging provides the logging configuration.

type RPC

type RPC struct {
	Server string `envconfig:"DRONE_RPC_SERVER"`
	Secret string `envconfig:"DRONE_RPC_SECRET"`
	Debug  bool   `envconfig:"DRONE_RPC_DEBUG"`
	Host   string `envconfig:"DRONE_RPC_HOST"`
	Proto  string `envconfig:"DRONE_RPC_PROTO"`
}

RPC provides the rpc configuration.

type Registries

type Registries struct {
	Endpoint   string `envconfig:"DRONE_REGISTRY_ENDPOINT"`
	Password   string `envconfig:"DRONE_REGISTRY_SECRET"`
	SkipVerify bool   `envconfig:"DRONE_REGISTRY_SKIP_VERIFY"`
}

Registries provides the registry configuration.

type Runner

type Runner struct {
	Platform   string            `envconfig:"DRONE_RUNNER_PLATFORM" default:"linux/amd64"`
	OS         string            `envconfig:"DRONE_RUNNER_OS"`
	Arch       string            `envconfig:"DRONE_RUNNER_ARCH"`
	Kernel     string            `envconfig:"DRONE_RUNNER_KERNEL"`
	Variant    string            `envconfig:"DRONE_RUNNER_VARIANT"`
	Machine    string            `envconfig:"DRONE_RUNNER_NAME"`
	Capacity   int               `envconfig:"DRONE_RUNNER_CAPACITY" default:"2"`
	Labels     map[string]string `envconfig:"DRONE_RUNNER_LABELS"`
	Volumes    []string          `envconfig:"DRONE_RUNNER_VOLUMES"`
	Networks   []string          `envconfig:"DRONE_RUNNER_NETWORKS"`
	Devices    []string          `envconfig:"DRONE_RUNNER_DEVICES"`
	Privileged []string          `envconfig:"DRONE_RUNNER_PRIVILEGED_IMAGES"`
	Environ    map[string]string `envconfig:"DRONE_RUNNER_ENVIRON"`
	Limits     struct {
		MemSwapLimit Bytes  `envconfig:"DRONE_LIMIT_MEM_SWAP"`
		MemLimit     Bytes  `envconfig:"DRONE_LIMIT_MEM"`
		ShmSize      Bytes  `envconfig:"DRONE_LIMIT_SHM_SIZE"`
		CPUQuota     int64  `envconfig:"DRONE_LIMIT_CPU_QUOTA"`
		CPUShares    int64  `envconfig:"DRONE_LIMIT_CPU_SHARES"`
		CPUSet       string `envconfig:"DRONE_LIMIT_CPU_SET"`
	}
}

Runner provides the runner configuration.

type Secrets

type Secrets struct {
	Endpoint   string `envconfig:"DRONE_SECRET_ENDPOINT"`
	Password   string `envconfig:"DRONE_SECRET_SECRET"`
	SkipVerify bool   `envconfig:"DRONE_SECRET_SKIP_VERIFY"`
}

Secrets provides the secret configuration.

type Server

type Server struct {
	Addr  string `envconfig:"-"`
	Host  string `envconfig:"DRONE_SERVER_HOST" default:"localhost:8080"`
	Proto string `envconfig:"DRONE_SERVER_PROTO" default:"http"`
}

Server provides the server configuration.

type UserCreate

type UserCreate struct {
	Username string
	Machine  bool
	Admin    bool
	Token    string
}

UserCreate stores account information used to bootstrap the admin user account when the system initializes.

func (*UserCreate) Decode

func (u *UserCreate) Decode(value string) error

Decode implements a decoder that extracts user information from the environment variable string.

Jump to

Keyboard shortcuts

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