config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 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 {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`

	ClusterName            string   `yaml:"clusterName" envconfig:"cluster_name"`
	AuthorizeURL           string   `yaml:"authorizeURL" envconfig:"authorize_url"`
	TokenURL               string   `yaml:"tokenURL" envconfig:"token_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"`
	ServeTLS               bool     `yaml:"serveTLS" envconfig:"serve_tls"`
	CertFile               string   `yaml:"certFile" envconfig:"cert_file"`
	KeyFile                string   `yaml:"keyFile" envconfig:"key_file"`
	APIServerURL           string   `yaml:"apiServerURL" envconfig:"apiserver_url"`
	ClusterCAPath          string   `yaml:"clusterCAPath" envconfig:"cluster_ca_path"`
	TrustedCAPath          string   `yaml:"trustedCAPath" envconfig:"trusted_ca_path"`
	HTTPPath               string   `yaml:"httpPath" envconfig:"http_path"`

	SessionSecurityKey     string `yaml:"sessionSecurityKey" envconfig:"SESSION_SECURITY_KEY"`
	CustomHTMLTemplatesDir string `yaml:"customHTMLTemplatesDir" envconfig:"custom_http_templates_dir"`
}

Config the configuration field for gangplank

func NewConfig

func NewConfig(configFile string) (*Config, error)

NewConfig returns a Config struct from serialized config file

func (*Config) GetRootPathPrefix

func (cfg *Config) GetRootPathPrefix() string

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

func (*Config) Validate

func (cfg *Config) Validate() error

Validate verifies all properties of config struct are intialized

type TransportConfig

type TransportConfig struct {
	HTTPClient *http.Client
}

TransportConfig describes a configured httpClient

func NewTransportConfig

func NewTransportConfig(trustedCAPath string) *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