config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: MIT Imports: 3 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth added in v1.2.0

type Auth struct {
	JWTEnabled    bool   `envconfig:"AUTH_JWT_ENABLED" default:"false"`      // Indicates if JWT authentication is enabled or not
	JWTSecret     string `envconfig:"AUTH_JWT_SECRET" default:"macilaci"`    // Secret of the JWT encryption
	JWTMethod     string `envconfig:"AUTH_JWT_METHOD" default:"secret"`      // Can be "secret" or "rsa", defines the decoding method
	JWTPubKeyPath string `envconfig:"AUTH_JWT_PUB_PATH" default:"./key.pub"` // Path to the public RSA key
}

Auth describes information regarding authentication

type CORS

type CORS struct {
	Enabled          bool     `envconfig:"CORS_ENABLED" default:"false"`           // Indicates if cors should be handled as configured or as default
	AllowedOrigins   []string `envconfig:"CORS_ALLOWED_ORIGINS" default:""`        // A list of origins a cross-domain request can be executed from.
	AllowCredentials bool     `envconfig:"CORS_ALLOW_CREDENTIALS" default:"false"` // Indicates whether the request can include user credentials like cookies, HTTP authentication or client side SSL certificates.
	MaxAge           int      `envconfig:"CORS_MAX_AGE" default:"0"`               // Indicates how long (in seconds) the results of a preflight request can be cached.
}

CORS is the ptions for cross origin handling

type Specification

type Specification struct {
	Debug        bool          `envconfig:"DEBUG" default:"false"`         // Indicates if debug log should be enabled or not
	Port         int           `envconfig:"PORT" default:"8080"`           // Port that the application listens on
	CleanupTime  time.Duration `envconfig:"CLEANUP_TIME" default:"2m0s"`   // Time period between process cleaning
	StoreDir     string        `envconfig:"STORE_DIR" default:"./videos"`  // Directory to store / service video chunks
	ListEndpoint bool          `envconfig:"LIST_ENDPOINT" default:"false"` // Turns on / off the stream listing endpoint feature

	CORS
	Auth
}

Specification describes the application context settings

func InitConfig

func InitConfig() *Specification

InitConfig is to initalise the config

Jump to

Keyboard shortcuts

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