config

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuntimeDocker     = "docker"
	RuntimeContainerd = "containerd"
)
View Source
const (
	ContainerdContentDir = "/var/lib/containerd/io.containerd.content.v1.content"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ApiKey           string        `envconfig:"API_KEY" required:"true"`
	ApiURL           string        `envconfig:"API_URL" default:"https://api.cast.ai"`
	ClusterID        string        `envconfig:"CLUSTER_ID" required:"true"`
	ImageID          string        `envconfig:"COLLECTOR_IMAGE_ID" required:"true"`
	ImageName        string        `envconfig:"COLLECTOR_IMAGE_NAME" required:"true"`
	Timeout          time.Duration `envconfig:"COLLECTOR_TIMEOUT" default:"5m"`
	Mode             Mode          `envconfig:"COLLECTOR_MODE"`
	Runtime          Runtime       `envconfig:"COLLECTOR_RUNTIME" required:"true"`
	ResourceIDs      string        `envconfig:"COLLECTOR_RESOURCE_IDS" required:"true"`
	DockerOptionPath string        `envconfig:"COLLECTOR_DOCKER_OPTION_PATH" default:""`
	BlobsCacheURL    string        `envconfig:"COLLECTOR_BLOBS_CACHE_URL" default:""`
	PprofAddr        string        `envconfig:"COLLECTOR_PPROF_ADDR" default:""`
	SlowMode         bool          `envconfig:"SLOW_MODE" default:"true"`
	// ImageLocalTarPath is used only with ModeTarArchive for local dev.
	ImageLocalTarPath string
}

func FromEnv

func FromEnv() (Config, error)

type Mode

type Mode string
const (
	ModeRemote Mode = "remote"
	ModeDaemon Mode = "daemon"
	ModeHostFS Mode = "hostfs"
	// ModeTarArchive is currently used only to test local tar archive images.
	// Loading image from docker daemon on macOS is super slow.
	ModeTarArchive Mode = "tar"
)

type Runtime

type Runtime string

Jump to

Keyboard shortcuts

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