config

package
v0.0.0-...-a9cc36f Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	DisableRegistration bool `yaml:"disableRegistration"`
	TokenLength         int  `yaml:"tokenLength" validate:"required,min=4"`
}

type Config

type Config struct {
	Port         int16          `yaml:"port" validate:"required,gte=1,lte=65535"`
	UseLocalCORS bool           `yaml:"useLocalCORS" validate:"required"`
	CleanLogs    bool           `yaml:"cleanLogs" validate:"required"`
	Redis        RedisConfig    `yaml:"redis" validate:"required"`
	Postgres     PostgresConfig `yaml:"postgres" validate:"required"`
	Auth         AuthConfig     `yaml:"auth" validate:"required"`
}

Config is the root config structure.

func ReadConfig

func ReadConfig() (*Config, error)

ReadConfig reads the config file and returns a Config struct.

type PostgresConfig

type PostgresConfig struct {
	URL string `vaml:"url"`
}

type RedisConfig

type RedisConfig struct {
	URL string `yaml:"url" validate:"required"`
}

RedisConfig is the config for the Redis database.

Jump to

Keyboard shortcuts

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