config

package
v0.0.0-...-ab6d3ba Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotConfig

type BotConfig struct {
	Ws           WsConfig
	Id           int64
	Debug        bool
	UseGoroutine bool
	ApiTimeout   int
}

func BotConfigFromYaml

func BotConfigFromYaml(s []byte) (*BotConfig, error)

func BotConfigFromYamlFile

func BotConfigFromYamlFile(path string) (*BotConfig, error)

func DefaultBotConfig

func DefaultBotConfig(id int64, token string) *BotConfig

func (*BotConfig) DebugMode

func (c *BotConfig) DebugMode(debug bool) *BotConfig

func (*BotConfig) GoroutineMode

func (c *BotConfig) GoroutineMode(useGoroutine bool) *BotConfig

func (*BotConfig) WithApiTimeout

func (c *BotConfig) WithApiTimeout(timeout int) *BotConfig

func (*BotConfig) WithWs

func (c *BotConfig) WithWs(host string, port int, endpoint string) *BotConfig

type LogConfig

type LogConfig struct {
	Level string
	Paths []string
	Debug bool
}

func DefaultLogConfig

func DefaultLogConfig() *LogConfig

func (*LogConfig) WithLevel

func (c *LogConfig) WithLevel(level string) *LogConfig

func (*LogConfig) WithPaths

func (c *LogConfig) WithPaths(path ...string) *LogConfig

func (*LogConfig) WithStderr

func (c *LogConfig) WithStderr() *LogConfig

func (*LogConfig) WithStdout

func (c *LogConfig) WithStdout() *LogConfig

type WsConfig

type WsConfig struct {
	Host        string
	Port        int
	Endpoint    string
	Token       string
	Timeout     int // in milliseconds
	PingPeriod  int // in milliseconds
	PongTimeout int // in milliseconds
}

Jump to

Keyboard shortcuts

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