config

package
v0.0.0-...-06a29e9 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EnvPrefix              string   `yaml:"-"`
	ClusterName            string   `yaml:"clusterName" envconfig:"cluster_name"`
	ProviderURL            string   `yaml:"providerURL" envconfig:"provider_url"`
	ClientID               string   `yaml:"clientID" envconfig:"client_id"`
	ClientSecret           string   `yaml:"clientSecret" envconfig:"client_secret"`
	AllowEmptyClientSecret bool     `yaml:"allowEmptyClientSecret" envconfig:"allow_empty_client_secret"`
	Audience               string   `yaml:"audience" envconfig:"audience"`
	RedirectURL            string   `yaml:"redirectURL" envconfig:"redirect_url"`
	Scopes                 []string `yaml:"scopes" envconfig:"scopes"`
	UsernameClaim          string   `yaml:"usernameClaim" envconfig:"username_claim"`
	EmailClaim             string   `yaml:"emailClaim" envconfig:"email_claim"`
	APIServerURL           string   `yaml:"apiServerURL" envconfig:"apiserver_url"`
	ClusterCAPath          string   `yaml:"clusterCAPath" envconfig:"cluster_ca_path"`
	ClusterCA              []byte
	ShowClaims             bool `yaml:"showClaims" envconfig:"show_claims"`
}

Config the configuration field for gangly

func (*Config) Validate

func (cfg *Config) Validate() error

Validate verifies all properties of config struct are intialized

type MultiClusterConfig

type MultiClusterConfig struct {
	Host                   string              `yaml:"host"`
	Port                   int                 `yaml:"port"`
	Clusters               map[string][]Config `yaml:"clusters"`
	HTTPPath               string              `yaml:"httpPath" envconfig:"http_path"`
	SessionSecurityKey     string              `yaml:"sessionSecurityKey" envconfig:"session_security_key"`
	SessionSalt            string              `yaml:"sessionSalt" envconfig:"session_salt"`
	CustomHTMLTemplatesDir string              `yaml:"customHTMLTemplatesDir" envconfig:"custom_html_templates_dir"`
	CustomAssetsDir        string              `yaml:"customAssetsDir" envconfig:"custom_assets_dir"`
	ServeTLS               bool                `yaml:"serveTLS" envconfig:"serve_tls"`
	CertFile               string              `yaml:"certFile" envconfig:"cert_file"`
	KeyFile                string              `yaml:"keyFile" envconfig:"key_file"`
	TrustedCAPath          string              `yaml:"trustedCAPath" envconfig:"trusted_ca_path"`
	TrustedCA              []byte
}

func NewMultiClusterConfig

func NewMultiClusterConfig(configFile string) (*MultiClusterConfig, error)

NewConfig returns a Config struct from serialized config file

func (*MultiClusterConfig) GetRootPathPrefix

func (clusterCfg *MultiClusterConfig) GetRootPathPrefix() string

GetRootPathPrefix returns '/' if no prefix is specified, otherwise returns the configured path

type TransportConfig

type TransportConfig struct {
	HTTPClient *http.Client
}

TransportConfig describes a configured httpClient

func NewTransportConfig

func NewTransportConfig(trustedCA []byte) *TransportConfig

NewTransportConfig returns a TransportConfig with configured httpClient

Jump to

Keyboard shortcuts

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