config

package
v0.0.0-...-7dc9028 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BotNamePaguMainnet   = "Pagu-Mainnet"
	BotNamePaguTestnet   = "Pagu-Testnet"
	BotNamePaguModerator = "Pagu-Moderator"
)
View Source
const (
	PriceCacheKey = "PriceCacheKey"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BotName      string          `yaml:"bot_name"`
	Network      string          `yaml:"network"`
	NetworkNodes []string        `yaml:"network_nodes"`
	LocalNode    string          `yaml:"local_node"`
	Database     Database        `yaml:"database"`
	AuthIDs      []string        `yaml:"auth_ids"`
	GRPC         *GRPC           `yaml:"grpc"` // ! TODO: config for modules should moved to the module.
	Wallet       *Wallet         `yaml:"wallet"`
	Logger       *Logger         `yaml:"logger"`
	HTTP         *HTTP           `yaml:"http"`
	Phoenix      *PhoenixNetwork `yaml:"phoenix"`
	DiscordBot   *DiscordBot     `yaml:"discord"`
	Telegram     *Telegram       `yaml:"telegram"`
	Notification *Notification   `yaml:"notification"`
}

func Load

func Load(path string) (*Config, error)

func (*Config) BasicCheck

func (cfg *Config) BasicCheck() error

BasicCheck validate presence of required config variables.

type Database

type Database struct {
	URL string `yaml:"url"`
}

type DiscordBot

type DiscordBot struct {
	Token   string `yaml:"token"`
	GuildID string `yaml:"guild_id"`
}

type GRPC

type GRPC struct {
	Listen string `yaml:"listen"`
}

type HTTP

type HTTP struct {
	Listen string `yaml:"listen"`
}

type Logger

type Logger struct {
	Filename   string   `yaml:"filename"`
	LogLevel   string   `yaml:"level"`
	Targets    []string `yaml:"targets"`
	MaxSize    int      `yaml:"max_size"`
	MaxBackups int      `yaml:"max_backups"`
	Compress   bool     `yaml:"compress"`
}

type Notification

type Notification struct {
	Zoho *Zoho `yaml:"zoho"`
}

type PhoenixNetwork

type PhoenixNetwork struct {
	FaucetAmount amount.Amount `yaml:"faucet_amount"`
}

type Telegram

type Telegram struct {
	BotToken string `yaml:"bot_token"`
}

type Wallet

type Wallet struct {
	Enable   bool   `yaml:"enable"`
	Address  string `yaml:"address"`
	Path     string `yaml:"path"`
	Password string `yaml:"password"`
	RPCUrl   string `yaml:"rpc"`
}

type ZapToMail

type ZapToMail struct {
	Host      string            `yaml:"host"`
	Port      int               `yaml:"port"`
	Username  string            `yaml:"username"`
	Password  string            `yaml:"password"`
	Templates map[string]string `yaml:"templates"`
}

type Zoho

type Zoho struct {
	Mail ZapToMail `yaml:"mail"`
}

Jump to

Keyboard shortcuts

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