server

package
v0.0.0-...-294dc8c Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg *Config) error

Run starts the manage server.

Types

type Config

type Config struct {
	// The struct tag `env` is used to populate the values from environment
	// variables. The first value is the name of the environment variable. After
	// a comma the default value can be given. If no default value is given, then
	// an empty string is used. The type of a env field has to be string.
	Port                     string `env:"MANAGE_PORT,9008"`
	ManageAuthPasswordFile   string `env:"MANAGE_AUTH_PASSWORD_FILE,/run/secrets/manage_auth_password"`
	InternalAuthPasswordFile string `env:"INTERNAL_AUTH_PASSWORD_FILE,/run/secrets/internal_auth_password"`
	SuperadminPasswordFile   string `env:"SUPERADMIN_PASSWORD_FILE,/run/secrets/superadmin"`

	ManageActionProtocol string `env:"ACTION_PROTOCOL,http"`
	ManageActionHost     string `env:"ACTION_HOST,backendManage"`
	ManageActionPort     string `env:"ACTION_PORT,9002"`

	DatastoreReaderProtocol string `env:"DATASTORE_READER_PROTOCOL,http"`
	DatastoreReaderHost     string `env:"DATASTORE_READER_HOST,datastore-reader"`
	DatastoreReaderPort     string `env:"DATASTORE_READER_PORT,9010"`

	OpenSlidesDevelopment string `env:"OPENSLIDES_DEVELOPMENT,0"`
	OpenSlidesLoglevel    string `env:"OPENSLIDES_LOGLEVEL,info"`
}

Config holds config data for the server.

func ConfigFromEnv

func ConfigFromEnv(loockup func(string) (string, bool)) *Config

ConfigFromEnv creates a Config object where the values are populated from the environment.

Example: cfg := ConfigFromEnv(os.LookupEnv)

Jump to

Keyboard shortcuts

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