config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: MIT Imports: 7 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 {
	ListenAddr  string       `json:"listen_addr" env:"WS_LISTEN_ADDR,notEmpty" envDefault:"0.0.0.0:16779"`
	MaxConn     int          `json:"max_conn" env:"WS_MAX_CONN" envDefault:"100"`
	IDWhitelist []string     `json:"id_whitelist" envPrefix:"WS_ID_WHITELIST"`
	SecretInfo  []SecretInfo `json:"secret_info" envPrefix:"WS_SECRET"`
	EnableAuth  bool         `json:"enable_auth" env:"WS_ENABLE_AUTH" envDefault:"false"`
	LogLevel    string       `json:"log_level" env:"WS_LOG_LEVEL" envDefault:"INFO"`
}

func ParseConfig

func ParseConfig() *Config

type SecretInfo

type SecretInfo struct {
	SecretKey string `json:"secret_key" env:"KEY,notEmpty"`
	MaxConn   int    `json:"max_conn" env:"MAX_CONN" envDefault:"5"`
}

Jump to

Keyboard shortcuts

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