config

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = "config.json"

Variables

View Source
var DefaultConfigJsonByte []byte

Functions

This section is empty.

Types

type Address

type Address struct {
	Ip   string `json:"ip"`
	Port string `json:"port"`
}

type Config

type Config struct {
	Port                string         `json:"port"`
	Debug               bool           `json:"debug"`
	NotAllowedDeleteLog bool           `json:"notAllowedDeleteLog"`
	RpcAddress          []*Address     `json:"rpcAddress"`
	CorsConfig          *CorsConfig    `json:"corsConfig"`
	StorageConfig       *StorageConfig `json:"storageConfig"`
	MaxRoomNumber       int            `json:"maxRoomNumber"`
	// max log file size, unit is mb
	MaxLogFileSizeOfMB int64 `json:"maxLogFileSizeOfMB"`
	// max log file size, unit is day
	MaxLogLifeTimeOfHour int64 `json:"maxLogLifeTimeOfHour"`
}

func LoadConfig

func LoadConfig() (*Config, error)

func (*Config) GetMaxLogFileSizeOfMB

func (c *Config) GetMaxLogFileSizeOfMB() int64

func (*Config) GetMaxLogLifeTimeOfHour

func (c *Config) GetMaxLogLifeTimeOfHour() int64

func (*Config) GetMaxRoomNumber

func (c *Config) GetMaxRoomNumber() int

func (*Config) IsRemoteStorage

func (c *Config) IsRemoteStorage() bool

type CorsConfig

type CorsConfig struct {
	AllowOrigins  []string `json:"allowOrigins"`
	AllowMethods  []string `json:"allowMethods"`
	AllowHeaders  []string `json:"allowHeaders"`
	ExposeHeaders []string `json:"exposeHeaders"`
}

type StaticConfig

type StaticConfig struct {
	DirName string
	Files   fs.FS
	GitHash string
	Version string
}

type StorageConfig

type StorageConfig struct {
	LogDirName string `json:"logDir"`
	BaseDir    string `json:"baseDir"`
	KeyId      string `json:"keyId"`
	Secret     string `json:"secret"`
	Region     string `json:"region"`
	Endpoint   string `json:"endpoint"`
	Bucket     string `json:"bucket"`
}

func (*StorageConfig) GetLogDir added in v1.7.2

func (s *StorageConfig) GetLogDir() string

Jump to

Keyboard shortcuts

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