config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module(
	"config",
	fx.Provide(Get),
	fx.Provide(func(cfg Config) Telegram {
		return cfg.Telegram
	}),
	fx.Provide(func(cfg Config) Censor {
		return cfg.Censor
	}),
	fx.Provide(func(cfg Config) Storage {
		return cfg.Storage
	}),
)

Functions

This section is empty.

Types

type Bot added in v0.1.0

type Bot struct {
	AdminID      int64 `envconfig:"BOT__ADMIN_ID" required:"true"`
	BanThreshold int   `envconfig:"BOT__BAN_THRESHOLD" default:"3"`
}

type Censor

type Censor struct {
	Blacklist []string `envconfig:"CENSOR__BLACKLIST"`
}

type Config

type Config struct {
	Telegram Telegram
	Censor   Censor
	Storage  Storage
}

func Get

func Get(logger *zap.Logger) Config

type Storage added in v0.1.0

type Storage struct {
	URL string `envconfig:"STORAGE__URL"`
}

type Telegram

type Telegram struct {
	Bot
	Token string `envconfig:"TELEGRAM__TOKEN" required:"true"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳