settings

package
v0.1.0-alpha.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	EnvAddonWorkingDir = "ADDON_WORKING_DIR"
	EnvHubBaseURL      = "HUB_BASE_URL"
	EnvHubToken        = "TOKEN"
	EnvTask            = "TASK"
)
View Source
const (
	EnvAuthRequired          = "AUTH_REQUIRED"
	EnvKeycloakHost          = "KEYCLOAK_HOST"
	EnvKeycloakRealm         = "KEYCLOAK_REALM"
	EnvKeycloakClientID      = "KEYCLOAK_CLIENT_ID"
	EnvKeycloakClientSecret  = "KEYCLOAK_CLIENT_SECRET"
	EnvKeycloakAdminUser     = "KEYCLOAK_ADMIN_USER"
	EnvKeycloakAdminPass     = "KEYCLOAK_ADMIN_PASS"
	EnvKeycloakAdminRealm    = "KEYCLOAK_ADMIN_REALM"
	EnvKeycloakReqPassUpdate = "KEYCLOAK_REQ_PASS_UPDATE"
	EnvBuiltinTokenKey       = "ADDON_TOKEN"
	EnvRolePath              = "ROLE_PATH"
	EnvUserPath              = "USER_PATH"
)

Environment variables

View Source
const (
	EnvNamespace         = "NAMESPACE"
	EnvDbPath            = "DB_PATH"
	EnvDbSeedPath        = "DB_SEED_PATH"
	EnvBucketPath        = "BUCKET_PATH"
	EnvRwxSupported      = "RWX_SUPPORTED"
	EnvCachePath         = "CACHE_PATH"
	EnvCachePvc          = "CACHE_PVC"
	EnvPassphrase        = "ENCRYPTION_PASSPHRASE"
	EnvTaskReapCreated   = "TASK_REAP_CREATED"
	EnvTaskReapSucceeded = "TASK_REAP_SUCCEEDED"
	EnvTaskReapFailed    = "TASK_REAP_FAILED"
	EnvTaskSA            = "TASK_SA"
	EnvTaskRetries       = "TASK_RETRIES"
	EnvFrequencyTask     = "FREQUENCY_TASK"
	EnvFrequencyReaper   = "FREQUENCY_REAPER"
	EnvDevelopment       = "DEVELOPMENT"
	EnvBucketTTL         = "BUCKET_TTL"
	EnvFileTTL           = "FILE_TTL"
	EnvAppName           = "APP_NAME"
	EnvDisconnected      = "DISCONNECTED"
)
View Source
const (
	MetricsPort = "METRICS_PORT"
)

Environment variables.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addon

type Addon struct {
	// Hub settings.
	Hub struct {
		// URL for the hub API.
		URL string
		// Token for the hub API.
		Token string
	}
	// Path.
	Path struct {
		// Working directory path.
		WorkingDir string
	}
	//
	Task int
}

Addon settings.

func (*Addon) Load

func (r *Addon) Load() (err error)

type Auth

type Auth struct {
	// Auth required
	Required bool
	// Keycloak client config
	Keycloak struct {
		Host         string
		Realm        string
		ClientID     string
		ClientSecret string
		Admin        struct {
			User  string
			Pass  string
			Realm string
		}
		RequirePasswordUpdate bool
	}
	// Path to role yaml
	RolePath string
	// Path to user yaml
	UserPath string
	// Token settings for builtin provider.
	Token struct {
		Key string
	}
}

func (*Auth) Load

func (r *Auth) Load() (err error)

type Hub

type Hub struct {
	// k8s namespace.
	Namespace string
	// DB settings.
	DB struct {
		Path     string
		SeedPath string
	}
	// Bucket settings.
	Bucket struct {
		Path string
		TTL  int
	}
	// File settings.
	File struct {
		TTL int
	}
	// Cache settings.
	Cache struct {
		RWX  bool
		Path string
		PVC  string
	}
	// Encryption settings.
	Encryption struct {
		Passphrase string
	}
	// Task
	Task struct {
		SA      string
		Retries int
		Reaper  struct {
			Created   int
			Succeeded int
			Failed    int
		}
	}
	// Frequency
	Frequency struct {
		Task   int
		Reaper int
		Volume int
	}
	// Development environment
	Development bool
	// Product - deployed as product.
	Product bool
	// Disconnected indicates no cluster.
	Disconnected bool
}

func (*Hub) Load

func (r *Hub) Load() (err error)

type Metrics

type Metrics struct {
	// Metrics port. 0 = disabled.
	Port int
}

Metrics settings

func (*Metrics) Address

func (r *Metrics) Address() string

Metrics address. Port = 0 will disable metrics.

func (*Metrics) Load

func (r *Metrics) Load() error

Load settings.

type TackleSettings

type TackleSettings struct {
	Hub
	Metrics
	Addon
	Auth
}
var Settings TackleSettings

func (*TackleSettings) Load

func (r *TackleSettings) Load() (err error)

Jump to

Keyboard shortcuts

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