config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config parses the config file for the blobstore.

Index

Constants

View Source
const (
	// ConfigLocation denotes the section of the *.ini file where the server configuration can
	// be found
	ConfigLocation = "BlobStore"
	// KeyHost is the configuration key where the value is the server host
	KeyHost = "host"
	// KeyMongoHost is the configuration key where the value is the MongoDB host
	KeyMongoHost = "mongodb-host"
	// KeyMongoDatabase is the configuration key where the value is the MongoDB database
	KeyMongoDatabase = "mongodb-database"
	// KeyMongoUser is the configuration key where the value is the MongoDB user name
	KeyMongoUser = "mongodb-user"
	// KeyMongoPwd is the configuration key where the value is the MongoDB user pwd
	KeyMongoPwd = "mongodb-pwd"
	// KeyS3Host is the configuration key where the value is the S3 host
	KeyS3Host = "s3-host"
	// KeyS3Bucket is the configuration key where the value is the S3 bucket in which files will
	// be stored.
	KeyS3Bucket = "s3-bucket"
	// KeyS3AccessKey is the configuration key where the value is the S3 access key
	KeyS3AccessKey = "s3-access-key"
	// KeyS3AccessSecret is the configuration key where the value is the S3 access secret
	KeyS3AccessSecret = "s3-access-secret"
	// KeyS3DisableSSL is the configuration key that determines whether SSL is to be used.
	// any value other than 'true' is treated as false.
	KeyS3DisableSSL = "s3-disable-ssl"
	// KeyS3DisableSSLVerify is the configuration key that determines whether to verify the
	// SSL certificate of the remote servers (in case a self-signed cert is used).
	// any value other than 'true' is treated as false.
	KeyS3DisableSSLVerify = "s3-disable-ssl-verify"
	// KeyS3Region is the configuration key where the value is the S3 region
	KeyS3Region = "s3-region"
	// KeyAuthURL is the configuration key where the value is the KBase auth server URL
	KeyAuthURL = "kbase-auth-url"
	// KeyAuthAdminRoles is the configuration key where the value is comma-delimited auth server
	// roles that denote that a user is a blobstore admin
	KeyAuthAdminRoles = "kbase-auth-admin-roles"
	// KeyDontTrustXIPHeaders is the configuration key where the value determines whether to
	// distrust the X-Forwarded-For and X-Real-IP headers (true) or not (anything else).
	KeyDontTrustXIPHeaders = "dont-trust-x-ip-headers"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Host is the host for the server, e.g. localhost:[port] or 0.0.0.0:[port]
	Host string
	// MongoHost is the host for the MongoDB database server.
	MongoHost string
	// MongoDatabase is the name of the MongoDB database to use.
	MongoDatabase string
	// MongoUser is the user name of the account to use to contact MongoDB.
	MongoUser string
	// MongoPwd is the password for the MongoDB account.
	MongoPwd string
	// S3Host is the host for the S3 API where files will be stored.
	S3Host string
	// S3Bucket the S3 bucket in which files will be stored.
	S3Bucket string
	// S3AccessKey is the S3 access key
	S3AccessKey string
	// S3AccessSecret is the S3 access secret
	S3AccessSecret string
	// S3DisableSSL determines whether SSL should be used
	S3DisableSSL bool
	// S3DisableSSLVerify determines whether SSL certs should be verified
	S3DisableSSLVerify bool
	// S3Region is the S3 region
	S3Region string
	// AuthURL is the KBase auth server URL. It is never nil.
	AuthURL *url.URL
	// AuthAdminRoles are the auth server roles that denote that a user is a blobstore admin.
	// It is never nil but may be empty.
	AuthAdminRoles *[]string
	// DontTrustXIPHeaders determines whether to distrust the X-Forwarded-For and X-Real-IP
	// headers.
	DontTrustXIPHeaders bool
}

Config contains the server configuration.

func New

func New(configFilePath string) (*Config, error)

New creates a new config struct from the given config file.

Jump to

Keyboard shortcuts

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