Documentation ¶
Index ¶
- Constants
- Variables
- func CheckEnv() error
- func DomainOf(addr string) string
- func EnvOpt(key, fallback string) string
- func GetEnvOpt(key string) (string, bool)
- func GetLoadFactor() float64
- func IsEnabled(value string) bool
- func LoadEnv(envfiles []string)
- func MustEnv(key string) string
- func SafeFilename(f string) string
- func UserDirFilename(filename string) (string, error)
- func UserDirGet(filename string) ([]byte, error)
- func UserDirGetString(filename string) (string, error)
- func UserDirPath(suffix string) (string, error)
- func UserDirPut(filename string, data []byte) error
- type Backend
- type BackendsConfig
- type Frontend
- type FrontendsConfig
- type Properties
Constants ¶
const ( EnvDbURL = "B3SCALE_DB_URL" EnvDbPoolSize = "B3SCALE_DB_POOL_SIZE" EnvLogLevel = "B3SCALE_LOG_LEVEL" EnvLogFormat = "B3SCALE_LOG_FORMAT" EnvListenHTTP = "B3SCALE_LISTEN_HTTP" EnvReverseProxy = "B3SCALE_REVERSE_PROXY_MODE" EnvLoadFactor = "B3SCALE_LOAD_FACTOR" EnvJWTSecret = "B3SCALE_API_JWT_SECRET" EnvAPIURL = "B3SCALE_API_URL" EnvAPIAccessToken = "B3SCALE_API_ACCESS_TOKEN" EnvBBBConfig = "BBB_CONFIG" EnvRecordingsPublishedPath = "B3SCALE_RECORDINGS_PUBLISHED_PATH" EnvRecordingsUnpublishedPath = "B3SCALE_RECORDINGS_UNPUBLISHED_PATH" EnvRecordingsPlaybackHost = "B3SCALE_RECORDINGS_PLAYBACK_HOST" )
Well Known Environment Keys
const ( EnvDbPoolSizeDefault = "128" EnvDbURLDefault = "postgres://postgres:postgres@localhost:5432/b3scale" EnvLogLevelDefault = "info" EnvLogFormatDefault = "structured" EnvListenHTTPDefault = "127.0.0.1:42353" // :B3S EnvReverseProxyDefault = "false" EnvBBBConfigDefault = "/etc/bigbluebutton/bbb-web.properties" EnvLoadFactorDefault = "1.0" )
Defaults
Variables ¶
var ( // ReMatchUnsafe matches everything not a-z, A-Z, 0-9 // and '.' from a string. ReMatchUnsafe = regexp.MustCompile(`[^a-zA-Z0-9.]`) // ReMatchUnderscoreSeq matches underscore sequences ReMatchUnderscoreSeq = regexp.MustCompile(`__+`) )
var ( // Version is a public global overridden at compile time // with the current version. Version string = "HEAD" // Build is the short commit hash Build string = "0000000" )
Functions ¶
func CheckEnv ¶ added in v1.1.1
func CheckEnv() error
CheckEnv checks if the environment is configured
func DomainOf ¶ added in v1.1.0
DomainOf returns the domain name (with TLD) of the given address or URL.
func GetEnvOpt ¶
GetEnvOpt gets a configuration from the environment, but will fail if the variable is not present.
func GetLoadFactor ¶
func GetLoadFactor() float64
GetLoadFactor retrievs the load factor from the environment.
func LoadEnv ¶
func LoadEnv(envfiles []string)
LoadEnv loads the environment from a file and updates the os.Environment
func MustEnv ¶ added in v1.1.0
MustEnv gets a configuration from the environment and will panic if the variable is empty.
func SafeFilename ¶
SafeFilename creates an urlsafe filename by stripping unsafe characters.
func UserDirFilename ¶
UserDirFilename gets the full path to a filename in the userdir
func UserDirGet ¶
UserDirGet retrievs content from a file in the b3scale user config directory
func UserDirGetString ¶
UserDirGetString retrievs a string from a file in the b3scale user config directory
func UserDirPath ¶
UserDirPath joins the file name with the full b3scale config path
func UserDirPut ¶
UserDirPut save a file in the b3scale config directory
Types ¶
type Backend ¶
Backend is the configuration of a cluster node
func NewBackend ¶
NewBackend creates a new Backend configuration and normalizes the Host url
type BackendsConfig ¶
BackendsConfig interface
type Frontend ¶
Frontend is the configuration of a a cluster consumer.
func NewFrontend ¶
NewFrontend creates a new frontend config
type FrontendsConfig ¶
FrontendsConfig interface
type Properties ¶
Properties is a map of BBB properties. The map stores the raw data. Retriving values should be done through the accessor which will resolve refs.
func ReadPropertiesFile ¶
func ReadPropertiesFile(filename string) (Properties, error)
ReadPropertiesFile consumes a BBB properties file