env

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OlympusGlobalEndpoint is a default olympus DNS address
	OlympusGlobalEndpoint = "http://localhost:3001"
)

Variables

This section is empty.

Functions

func AthensMaxConcurrency

func AthensMaxConcurrency() int

AthensMaxConcurrency retrieves maximal level of concurrency based on ATHENS_MAX_CONCURRENCY. Defaults to number of cores if env is not set.

func AthensPathPrefix added in v0.1.0

func AthensPathPrefix() string

AthensPathPrefix returns whether the Proxy (or Olympus) should have a basepath. Certain proxies and services are distinguished based on subdomain, while others are based on path prefixes.

func BasicAuth added in v0.1.0

func BasicAuth() (user, pass string, ok bool)

BasicAuth returns BASIC_AUTH_USER and BASIC_AUTH_PASSWORD and ok if either of them are empty

func BuffaloLogLevel added in v0.1.0

func BuffaloLogLevel() (logrus.Level, error)

BuffaloLogLevel returns the log level for logs emitted by Buffalo itself. This is different from our own LogLevel in this file because you might want info level for our codebase, but panic level for buffalo.

func CDNEndpointWithDefault

func CDNEndpointWithDefault(value *url.URL) *url.URL

CDNEndpointWithDefault returns CDN endpoint if set if not it should default to clouds default blob storage endpoint e.g

func CloudRuntime

func CloudRuntime() string

CloudRuntime returns the Cloud Provider underneath which the Proxy/Registry is running.

func DiskRoot

func DiskRoot() (string, error)

DiskRoot returns Athens Mongo Disk Root folder defined by ATHENS_DISK_STORAGE_ROOT

func EnableCSRFProtection

func EnableCSRFProtection() bool

EnableCSRFProtection determines whether to enable CSRF protection

func FilterConfigurationFileName added in v0.1.0

func FilterConfigurationFileName() string

FilterConfigurationFileName specifies file name for include exclude private filter If no filename is specified it fallbacks to 'filter.conf'

func FilterOff added in v0.1.0

func FilterOff() bool

FilterOff checks PROXY_FILTER_OFF env and returns true of it's equal to "true", otherwise false always. It defaults to "true" until Olympus is the default place to grab modules before the Proxy.

func GCPBucketName added in v0.1.0

func GCPBucketName() (string, error)

GCPBucketName returns Google Cloud Storage bucket name defined by ATHENS_STORAGE_GCP_BUCKET

func GCPProjectID added in v0.1.0

func GCPProjectID() string

GCPProjectID returns the project id on which the project is running or the cloud storage is using.

func GetOlympusEndpoint added in v0.1.0

func GetOlympusEndpoint() string

GetOlympusEndpoint returns global endpoint with override in mind

func GoBinPath

func GoBinPath() string

GoBinPath returns the path to the go binary to use, defined by GO_BINARY_PATH. This value can be a name on the PATH, or the full path

func GoEnvironmentWithDefault

func GoEnvironmentWithDefault(value string) string

GoEnvironmentWithDefault returns environment used. Supported values are: 'development' and 'production'

func GoGetWorkers added in v0.1.0

func GoGetWorkers() int

GoGetWorkers returns how many times you can concurrently go mod download, this is so that low performance instances can manage go get more sanely and not run out of disk or memory.

func LogLevel

func LogLevel() (logrus.Level, error)

LogLevel returns the system's exposure to internal logs. Defaults to debug.

func MinioAccessKeyID

func MinioAccessKeyID() (string, error)

MinioAccessKeyID returns Minio access key ID defined by ATHENS_MINIO_ACCESS_KEY_ID.

func MinioBucketNameWithDefault

func MinioBucketNameWithDefault(value string) string

MinioBucketNameWithDefault returns bucket name used with Minio. Defined by ATHENS_MINIO_BUCKET_NAME.

func MinioEndpoint

func MinioEndpoint() (string, error)

MinioEndpoint returns Minio endpoing URI defined by ATHENS_MINIO_ENDPOINT.

func MinioSSLWithDefault

func MinioSSLWithDefault(value string) string

MinioSSLWithDefault returns flag whether or not SSL should be used with Minio. Defined by ATHENS_MINIO_USE_SSL.

func MinioSecretAccessKey

func MinioSecretAccessKey() (string, error)

MinioSecretAccessKey returns Minio secret access key defined by ATHENS_MINIO_SECRET_ACCESS_KEY.

func MongoCertPath added in v0.1.0

func MongoCertPath() string

MongoCertPath returns Athens Mongo Storage cert path string defined by ATHENS_MONGO_CERT_PATH

func MongoConnectionString added in v0.1.0

func MongoConnectionString() (string, error)

MongoConnectionString returns Athens Mongo Storage connection string defined by ATHENS_MONGO_CONNECTION_STRING

func MongoConnectionTimeoutSecWithDefault added in v0.1.0

func MongoConnectionTimeoutSecWithDefault(defTimeout int) time.Duration

MongoConnectionTimeoutSecWithDefault returns Athens Mongo Storage connection timeout defined by MONGO_CONN_TIMEOUT_SEC. Values are in seconds.

func MongoHost

func MongoHost() (string, error)

MongoHost returns Athens Mongo host defined by MONGO_HOST

func MongoPassword

func MongoPassword() (string, error)

MongoPassword returns Athens Mongo Storage user password defined by MONGO_PASSWORD

func MongoPort

func MongoPort() (string, error)

MongoPort returns Athens Mongo port defined by MONGO_PORT

func MongoSSLWithDefault

func MongoSSLWithDefault(value string) string

MongoSSLWithDefault returns Athens Mongo Storage SSL flag defined by MONGO_SSL. Defines whether or not SSL should be used.

func MongoUser

func MongoUser() (string, error)

MongoUser returns Athens Mongo Storage user defined by MONGO_USER

func NETRCPath added in v0.1.0

func NETRCPath() string

NETRCPath tells you where the .netrc path initially resides. This is so that you can mount the .netrc file to a secret location in the fs system and then move it ~/.netrc. In certain deployments like Kubernetes, we can't mount directly to ~ because it would then clean out whatever is already there as part of the image (such as .cache directory in the Go image).

func OlympusBackgroundWorkerType added in v0.1.0

func OlympusBackgroundWorkerType() string

OlympusBackgroundWorkerType determines the background worker type used for Registry (Olympus). (redis, memory) Default - redis

func OlympusGlobalEndpointWithDefault

func OlympusGlobalEndpointWithDefault(value string) string

OlympusGlobalEndpointWithDefault returns Olympus global endpoint defined by OLYMPUS_GLOBAL_ENDPOINT.

func OlympusRedisQueuePortWithDefault

func OlympusRedisQueuePortWithDefault(value string) string

OlympusRedisQueuePortWithDefault returns Redis queue port used by workers defined by OLYMPUS_REDIS_QUEUE_PORT. Standard port is 6379

func Port

func Port(value string) string

Port returns the PORT env var that a server (Olympus/Zeus) should run on. Buffalo uses the PORT environment so this keeps it consistent but can also be used directly as a Buffalo service option

func ProxyForceSSL added in v0.1.0

func ProxyForceSSL() bool

ProxyForceSSL returns true if the PROXY_FORCE_SSL env is set to "true", otherwise defaults to false. This is used to make sure the Proxy would redirect to https on any request.

func RedisQueuePortWithDefault

func RedisQueuePortWithDefault(value string) string

RedisQueuePortWithDefault returns Redis queue port used by workers defined by ATHENS_REDIS_QUEUE_PORT. Standard port is 6379

func StorageType

func StorageType() (string, error)

StorageType returns storage type used by Athens with error if env is not set. Possible values are memory, disk, mongo

func StorageTypeWithDefault

func StorageTypeWithDefault(value string) string

StorageTypeWithDefault returns storage type used by Athens with default value if env is not set. Possible values are memory, disk, mongo

func Timeout

func Timeout() time.Duration

Timeout is timeout for external network calls

func ValidatorHook added in v0.1.0

func ValidatorHook() (endpoint string, found bool)

ValidatorHook specifies the url of the endpoint to validate the modules agains It returns the endpoint (if it was configured) and a bool meaning that the endpoint return value is valid

func WorkerMaxFails

func WorkerMaxFails() uint

WorkerMaxFails retrieves maximal level of concurrency based on ATHENS_WORKER_MAX_FAILS. Defaults to 5.

Types

This section is empty.

Jump to

Keyboard shortcuts

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