configuration

package
v0.0.0-...-bf90f01 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 8 Imported by: 30

Documentation

Overview

Package configuration is in charge of the validation and extraction of all the configuration details from a configuration file.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Commit current build commit set by build script
	Commit = "0"
	// BuildTime set by build script in ISO 8601 (UTC) format: YYYY-MM-DDThh:mm:ssTZD (see https://www.w3.org/TR/NOTE-datetime for details)
	BuildTime = "0"
	// StartTime in ISO 8601 (UTC) format
	StartTime = time.Now().UTC().Format("2006-01-02T15:04:05Z")
)

Functions

This section is empty.

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data encapsulates the Viper configuration object which stores the configuration data in-memory.

func GetData

func GetData() (*Data, error)

GetData is a wrapper over NewData which reads configuration file path from the environment variable.

func NewData

func NewData() (*Data, error)

NewData creates a configuration reader object using a configurable configuration file path

func (*Data) APIServerInsecureSkipTLSVerify

func (c *Data) APIServerInsecureSkipTLSVerify() bool

APIServerInsecureSkipTLSVerify returns if the server's certificate should be checked for validity. This will make your HTTPS connections insecure.

func (*Data) APIServerUseTLS

func (c *Data) APIServerUseTLS() bool

APIServerUseTLS returns if the server uses secured HTTPS connections.

func (*Data) GetAuthClientID

func (c *Data) GetAuthClientID() string

GetAuthClientID returns the tenant's client id used while communicating with fabric8-auth

func (*Data) GetAuthGrantType

func (c *Data) GetAuthGrantType() string

GetAuthGrantType returns the fabric8-auth Grant type used while retrieving user account token

func (*Data) GetAuthURL

func (c *Data) GetAuthURL() string

GetAuthURL returns Auth service URL

func (*Data) GetAutomatedUpdateRetrySleep

func (c *Data) GetAutomatedUpdateRetrySleep() time.Duration

GetAutomatedUpdateRetrySleep returns the duration the automated update should wait to detect if there is some other ongoing update

func (*Data) GetAutomatedUpdateTimeGap

func (c *Data) GetAutomatedUpdateTimeGap() time.Duration

GetAutomatedUpdateTimeGap returns the duration the automated update should wait after single tenant update

func (*Data) GetClientSecret

func (c *Data) GetClientSecret() string

GetClientSecret returns the secret which will be used in conjunction with the tenant client id

func (*Data) GetClustersRefreshDelay

func (c *Data) GetClustersRefreshDelay() time.Duration

GetClustersRefreshDelay returns delay of clusters refresh (in minutes)

func (*Data) GetConsoleURL

func (c *Data) GetConsoleURL() string

GetConsoleURL returns the fabric8-ui Console URL

func (*Data) GetEnvironment

func (c *Data) GetEnvironment() string

GetEnvironment returns the current environment application is deployed in like 'prod', 'preview', 'local', etc as the value of environment variable `F8_ENVIRONMENT` is set.

func (*Data) GetHTTPAddress

func (c *Data) GetHTTPAddress() string

GetHTTPAddress returns the HTTP address (as set via default, config file, or environment variable) that the alm server binds to (e.g. "0.0.0.0:8080")

func (*Data) GetKeycloakClientID

func (c *Data) GetKeycloakClientID() string

GetKeycloakClientID returns the keycloak client id (mostly for Che)

func (*Data) GetKeycloakOpenshiftBroker

func (c *Data) GetKeycloakOpenshiftBroker() string

GetKeycloakOpenshiftBroker returns the keycloak broker name for openshift

func (*Data) GetKeycloakRealm

func (c *Data) GetKeycloakRealm() string

GetKeycloakRealm returns the keycloak realm name

func (*Data) GetKeycloakURL

func (c *Data) GetKeycloakURL() string

GetKeycloakURL returns Keycloak URL used by default in Dev mode

func (*Data) GetLogLevel

func (c *Data) GetLogLevel() string

GetLogLevel returns the loggging level (as set via config file or environment variable)

func (*Data) GetMetricsHTTPAddress

func (c *Data) GetMetricsHTTPAddress() string

GetMetricsHTTPAddress returns the address the /metrics endpoing will be mounted. By default GetMetricsHTTPAddress is the same as GetHTTPAddress

func (*Data) GetPostgresConfigString

func (c *Data) GetPostgresConfigString() string

GetPostgresConfigString returns a ready to use string for usage in sql.Open()

func (*Data) GetPostgresConnectionMaxIdle

func (c *Data) GetPostgresConnectionMaxIdle() int

GetPostgresConnectionMaxIdle returns the number of connections that should be keept alive in the database connection pool at any given time. -1 represents no restrictions/default behavior

func (*Data) GetPostgresConnectionMaxOpen

func (c *Data) GetPostgresConnectionMaxOpen() int

GetPostgresConnectionMaxOpen returns the max number of open connections that should be open in the database connection pool. -1 represents no restrictions/default behavior

func (*Data) GetPostgresConnectionRetrySleep

func (c *Data) GetPostgresConnectionRetrySleep() time.Duration

GetPostgresConnectionRetrySleep returns the number of seconds (as set via default, config file, or environment variable) to wait before trying to connect again

func (*Data) GetPostgresConnectionTimeout

func (c *Data) GetPostgresConnectionTimeout() int64

GetPostgresConnectionTimeout returns the postgres connection timeout as set via default, config file, or environment variable

func (*Data) GetPostgresDatabase

func (c *Data) GetPostgresDatabase() string

GetPostgresDatabase returns the postgres database as set via default, config file, or environment variable

func (*Data) GetPostgresHost

func (c *Data) GetPostgresHost() string

GetPostgresHost returns the postgres host as set via default, config file, or environment variable

func (*Data) GetPostgresPassword

func (c *Data) GetPostgresPassword() string

GetPostgresPassword returns the postgres password as set via default, config file, or environment variable

func (*Data) GetPostgresPort

func (c *Data) GetPostgresPort() int64

GetPostgresPort returns the postgres port as set via default, config file, or environment variable

func (*Data) GetPostgresSSLMode

func (c *Data) GetPostgresSSLMode() string

GetPostgresSSLMode returns the postgres sslmode as set via default, config file, or environment variable

func (*Data) GetPostgresUser

func (c *Data) GetPostgresUser() string

GetPostgresUser returns the postgres user as set via default, config file, or environment variable

func (*Data) GetSentryDSN

func (c *Data) GetSentryDSN() string

GetSentryDSN returns the secret needed to securely communicate with https://errortracking.prod-preview.openshift.io/openshift_io/fabric8-tenant/

func (*Data) GetTemplateValues

func (c *Data) GetTemplateValues() (map[string]string, error)

GetTemplateValues return a Map of additional variables used to process the templates

func (*Data) GetTogglesURL

func (c *Data) GetTogglesURL() string

GetTogglesURL returns Toggle service URL

func (*Data) GetTokenKey

func (c *Data) GetTokenKey() string

GetTokenKey returns the encryption key/passphrase which will be used to decrypt the cluster tokens stored in auth token mgm

func (*Data) IsAutomatedUpdateEnabled

func (c *Data) IsAutomatedUpdateEnabled() bool

IsAutomatedUpdateEnabled returns if the automated update is enabled

func (*Data) IsDeveloperModeEnabled

func (c *Data) IsDeveloperModeEnabled() bool

IsDeveloperModeEnabled returns if development related features (as set via default, config file, or environment variable), e.g. token generation endpoint are enabled

func (*Data) IsLogJSON

func (c *Data) IsLogJSON() bool

IsLogJSON returns if we should log json format (as set via config file or environment variable)

func (*Data) String

func (c *Data) String() string

String returns the current configuration as a string

func (*Data) UseOpenshiftCurrentCluster

func (c *Data) UseOpenshiftCurrentCluster() bool

UseOpenshiftCurrentCluster returns if we should use the current cluster to provision tenant service

type HTTPClientOption

type HTTPClientOption func(client *http.Client)

HTTPClientOption options passed to the HTTP Client

func WithRoundTripper

func WithRoundTripper(r http.RoundTripper) HTTPClientOption

WithRoundTripper configures the client's transport with the given round-tripper

Jump to

Keyboard shortcuts

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