config

package
v0.0.0-...-c380036 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Listen struct {
		Ip   string `yaml:"ip" env-default:"0.0.0.0" validate:"required,ip"`
		Port string `yaml:"port" env-default:"8080" validate:"required,numeric"`
	} `yaml:"listen"`
	Storage struct {
		Host     string `yaml:"host" validate:"required,alpha"`
		Port     string `yaml:"port" validate:"required,numeric"`
		Username string `yaml:"username" validate:"required"`
		Password string `yaml:"password" validate:"required"`
		Database string `yaml:"database" validate:"required"`
		Options  struct {
			Collection string `yaml:"collection" validate:"omitempty,alpha"`
			AuthDB     string `yaml:"auth_db" validate:"omitempty,alpha"`
		} `yaml:"options"`
	} `yaml:"storage"`
	Auth struct {
		AccessTokenTTL string `yaml:"accessTokenTTL" validate:"required"`
	} `yaml:"auth"`
	WS struct {
		WsHost string `yaml:"wsHost" validate:"required"`
	} `yaml:"ws"`
}

func GetConfig

func GetConfig(cfgPath string, instance *Config) *Config

Jump to

Keyboard shortcuts

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