Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ClientIDEnvVar is the environment variable key that represents the registered // Client ID for this web app. ClientIDEnvVar = "CONSOLE_CLIENT_ID" // ClientSecretEnvVar is the environment variable key that represents the // Client Secret associated with the registered Client ID for this web app. ClientSecretEnvVar = "CONSOLE_CLIENT_SECRET" // HostnameEnvVar is the environment variable key that represents the hostname // of this web app. HostnameEnvVar = "CONSOLE_HOSTNAME" // LoginURLEnvVar is the environment variable key that represents the // base login URL endpoint that this app should use to authenticate users. LoginURLEnvVar = "CONSOLE_LOGIN_URL" // UAAURLEnvVar is the environment variable key that represents the // base uaa URL endpoint that this app should use to get tokens. UAAURLEnvVar = "CONSOLE_UAA_URL" // APIURLEnvVar is the environment variable key that represents the // base api URL endpoint that this app should use to access cloud foundry data. APIURLEnvVar = "CONSOLE_API_URL" // LogURLEnvVar is the environment variable key that represents the // endpoint to the loggregator. LogURLEnvVar = "CONSOLE_LOG_URL" // PProfEnabledEnvVar is the environment variable key that represents if the pprof routes // should be enabled. If no value is specified, it is assumed to be false. PProfEnabledEnvVar = "PPROF_ENABLED" // BuildInfoEnvVar is the environment variable key that represents the particular build number BuildInfoEnvVar = "BUILD_INFO" )
var TimeoutConstant = time.Second * 5
TimeoutConstant is a constant which holds how long any incoming request should wait until we timeout. This is useful as some calls from the Go backend to the external API may take a long time. If the user decides to refresh or if the client is polling, multiple requests might build up. This timecaps them. This constant is also used in the acceptance testing "delayForRendering" for any pages that may take a long time to render. (Some of those pages use APIs that take a long time)
Functions ¶
Types ¶
type EnvVars ¶
type EnvVars struct { ClientID string ClientSecret string Hostname string LoginURL string UAAURL string APIURL string LogURL string PProfEnabled string BuildInfo string }
EnvVars holds all the environment variable values that a non-test server should have.
type Settings ¶
type Settings struct { // OAuthConfig is the OAuth client with all the paramters to talk with CF's UAA OAuth Provider. OAuthConfig *oauth2.Config // Console API ConsoleAPI string // Login URL - used to redirect users to the logout page LoginURL string // Sessions is the session store for all connected users. Sessions sessions.Store // context.Context var from golang.org/x/net/context to make token Client work TokenContext context.Context // UAA API UaaURL string // Log API LogURL string // High Privileged OauthConfig HighPrivilegedOauthConfig *clientcredentials.Config // A flag to indicate whether profiling should be included (debug purposes). PProfEnabled bool // Build Info BuildInfo string }
Settings is the object to hold global values and objects for the service.
func (*Settings) InitSettings ¶
InitSettings attempts to populate all the fields of the Settings struct. It will return an error if it fails, otherwise it returns nil for success.