config

package
v0.0.0-...-6e75e83 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConf

type AppConf struct {
	AppName  string    `yaml:"app_name"`
	TestApp  bool      `yaml:"test_app"`
	Server   *Server   `yaml:"server"`
	Logger   *Logger   `yaml:"logger"`
	DB       *DB       `yaml:"database_url"`
	Token    *Token    `yaml:"token"`
	Telegram *Telegram `yaml:"telegram"`
	ChatGPT  *ChatGPT  `yaml:"chatgpt"`
}

func NewAppConf

func NewAppConf() AppConf

func (*AppConf) Init

func (a *AppConf) Init(logger *zap.Logger)

type ChatGPT

type ChatGPT struct {
	Token string `yaml:"token"`
}

type DB

type DB struct {
	Name     string `yaml:"name"`
	User     string `json:"-" yaml:"user"`
	Password string `json:"-" yaml:"password"`
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
}

type Logger

type Logger struct {
	Level   string `yaml:"level"`
	LogPath string `yaml:"log_file"`
}

type Server

type Server struct {
	Port            string        `yaml:"port"`
	ShutdownTimeout time.Duration `yaml:"shutdown_timeout"`
}

type Telegram

type Telegram struct {
	AppID   int    `yaml:"app_id"`
	ApiHash string `yaml:"token"`
	Phone   string `yaml:"phone"`
}

type Token

type Token struct {
	AccessTTL     time.Duration `yaml:"access_ttl"`
	RefreshTTL    time.Duration `yaml:"refresh_ttl"`
	AccessSecret  string        `yaml:"access_secret"`
	RefreshSecret string        `yaml:"refresh_secret"`
}

Jump to

Keyboard shortcuts

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