Documentation ¶
Index ¶
- Constants
- func AthensMaxConcurrency() int
- func AthensPathPrefix() string
- func BasicAuth() (user, pass string, ok bool)
- func BuffaloLogLevel() (logrus.Level, error)
- func CDNEndpointWithDefault(value *url.URL) *url.URL
- func CloudRuntime() string
- func DiskRoot() (string, error)
- func EnableCSRFProtection() bool
- func FilterConfigurationFileName() string
- func FilterOff() bool
- func GCPBucketName() (string, error)
- func GCPProjectID() string
- func GetOlympusEndpoint() string
- func GoBinPath() string
- func GoEnvironmentWithDefault(value string) string
- func GoGetWorkers() int
- func LogLevel() (logrus.Level, error)
- func MinioAccessKeyID() (string, error)
- func MinioBucketNameWithDefault(value string) string
- func MinioEndpoint() (string, error)
- func MinioSSLWithDefault(value string) string
- func MinioSecretAccessKey() (string, error)
- func MongoCertPath() string
- func MongoConnectionString() (string, error)
- func MongoConnectionTimeoutSecWithDefault(defTimeout int) time.Duration
- func MongoHost() (string, error)
- func MongoPassword() (string, error)
- func MongoPort() (string, error)
- func MongoSSLWithDefault(value string) string
- func MongoUser() (string, error)
- func NETRCPath() string
- func OlympusBackgroundWorkerType() string
- func OlympusGlobalEndpointWithDefault(value string) string
- func OlympusRedisQueuePortWithDefault(value string) string
- func Port(value string) string
- func ProxyForceSSL() bool
- func RedisQueuePortWithDefault(value string) string
- func StorageType() (string, error)
- func StorageTypeWithDefault(value string) string
- func Timeout() time.Duration
- func ValidatorHook() (endpoint string, found bool)
- func WorkerMaxFails() uint
Constants ¶
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
BasicAuth returns BASIC_AUTH_USER and BASIC_AUTH_PASSWORD and ok if either of them are empty
func BuffaloLogLevel ¶ added in v0.1.0
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 ¶
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 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
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 ¶
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 MinioAccessKeyID ¶
MinioAccessKeyID returns Minio access key ID defined by ATHENS_MINIO_ACCESS_KEY_ID.
func MinioBucketNameWithDefault ¶
MinioBucketNameWithDefault returns bucket name used with Minio. Defined by ATHENS_MINIO_BUCKET_NAME.
func MinioEndpoint ¶
MinioEndpoint returns Minio endpoing URI defined by ATHENS_MINIO_ENDPOINT.
func MinioSSLWithDefault ¶
MinioSSLWithDefault returns flag whether or not SSL should be used with Minio. Defined by ATHENS_MINIO_USE_SSL.
func MinioSecretAccessKey ¶
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
MongoConnectionString returns Athens Mongo Storage connection string defined by ATHENS_MONGO_CONNECTION_STRING
func MongoConnectionTimeoutSecWithDefault ¶ added in v0.1.0
MongoConnectionTimeoutSecWithDefault returns Athens Mongo Storage connection timeout defined by MONGO_CONN_TIMEOUT_SEC. Values are in seconds.
func MongoPassword ¶
MongoPassword returns Athens Mongo Storage user password defined by MONGO_PASSWORD
func MongoSSLWithDefault ¶
MongoSSLWithDefault returns Athens Mongo Storage SSL flag defined by MONGO_SSL. Defines whether or not SSL should be used.
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 ¶
OlympusGlobalEndpointWithDefault returns Olympus global endpoint defined by OLYMPUS_GLOBAL_ENDPOINT.
func OlympusRedisQueuePortWithDefault ¶
OlympusRedisQueuePortWithDefault returns Redis queue port used by workers defined by OLYMPUS_REDIS_QUEUE_PORT. Standard port is 6379
func Port ¶
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 ¶
RedisQueuePortWithDefault returns Redis queue port used by workers defined by ATHENS_REDIS_QUEUE_PORT. Standard port is 6379
func StorageType ¶
StorageType returns storage type used by Athens with error if env is not set. Possible values are memory, disk, mongo
func StorageTypeWithDefault ¶
StorageTypeWithDefault returns storage type used by Athens with default value if env is not set. Possible values are memory, disk, mongo
func ValidatorHook ¶ added in v0.1.0
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.