config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// EnvKeyRoot the environment variable key for runtime root dir
	EnvKeyRoot = "TEMPORAL_ROOT"
	// EnvKeyConfigDir the environment variable key for config dir
	EnvKeyConfigDir = "TEMPORAL_CONFIG_DIR"
	// EnvKeyEnvironment is the environment variable key for environment
	EnvKeyEnvironment = "TEMPORAL_ENVIRONMENT"
)

Variables

This section is empty.

Functions

func Load

func Load(configDir string, config interface{}, env string) error

Load loads the configuration from a set of yaml config files found in the config directory

The loader first fetches the set of files matching a pre-determined naming convention, then sorts them by hierarchy order and after that, simply loads the files one after another with the key/values in the later files overriding the key/values in the earlier files

The hierarchy is as follows from lowest to highest

base.yaml
    env.yaml   -- environment is one of the input params ex-development

Types

type Auth

type Auth struct {
	Enabled   bool           `yaml:"enabled"`
	Providers []AuthProvider `yaml:"providers"`
}

func (*Auth) Validate

func (c *Auth) Validate() error

Validate validates the persistence config

type AuthProvider

type AuthProvider struct {
	Label        string   `yaml:"label"`
	Type         string   `yaml:"type"`
	ProviderUrl  string   `yaml:"providerUrl"`
	ClientID     string   `yaml:"clientId"`
	ClientSecret string   `yaml:"clientSecret"`
	Scopes       []string `yaml:"scopes"`
	Audience     string   `yaml:"audience"`
	CallbackURL  string   `yaml:"callbackUrl"`
	PassIDToken  bool     `yaml:"passIdToken"`
}

type CORS

type CORS struct {
	AllowOrigins []string `yaml:"allowOrigins"`
}

type Config

type Config struct {
	TemporalGRPCAddress string `yaml:"temporalGrpcAddress"`
	Host                string `yaml:"host"`
	Port                int    `yaml:"port"`
	UIRootPath          string `yaml:"uiRootPath"`
	TLS                 TLS    `yaml:"tls"`
	Auth                Auth   `yaml:"auth"`
	EnableUI            bool   `yaml:"enableUi"`
	EnableOpenAPI       bool   `yaml:"enableOpenApi"`
	CORS                CORS   `yaml:"cors"`
}

Config contains the configuration for the UI server

func LoadConfig

func LoadConfig(configDir string, env string) (*Config, error)

Helper function for loading configuration

func (*Config) Validate

func (c *Config) Validate() error

Validate validates this config

type TLS added in v0.2.0

type TLS struct {
	CaFile                 string `yaml:"caFile"`
	CertFile               string `yaml:"certFile"`
	KeyFile                string `yaml:"keyFile"`
	CaData                 string `yaml:"caData"`
	CertData               string `yaml:"certData"`
	KeyData                string `yaml:"keyData"`
	EnableHostVerification bool   `yaml:"enableHostVerification"`
	ServerName             string `yaml:"serverName"`
}

Jump to

Keyboard shortcuts

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