config

package
v0.0.0-...-aeb1ad3 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig() error

Types

type MNConfig

type MNConfig struct {
	Server   MNConfigServer   `validate:"required"`
	Database MNConfigDatabase `validate:"required"`
	Redis    MNConfigRedis    `validate:"required"`
	System   MNConfigSystem   `validate:"required"`
}
var Config *MNConfig

type MNConfigDatabase

type MNConfigDatabase struct {
	Host     string
	Port     uint16
	User     string
	Password string
	Name     string
	SSLMode  string
}

type MNConfigRedis

type MNConfigRedis struct {
	Host     string
	Port     uint16
	User     string
	Password string
	Database int
}

type MNConfigServer

type MNConfigServer struct {
	Host    string
	Port    uint16
	Prefork bool
}

type MNConfigSystem

type MNConfigSystem struct {
	// RegistrationMode: 0 -> Registration disabled, 1 -> Invite only, 2 -> Open
	RegistrationMode uint `toml:"registration_mode" validate:"gte=0,lte=2"`
	// InvitePermission: 0 -> Administrator only, 1 -> Administrator and Moderator only, 2 -> Everyone
	InvitePermission uint `toml:"invite_permission" validate:"gte=0,lte=2"`
}

Jump to

Keyboard shortcuts

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