config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmqpConfig

type AmqpConfig struct {
	Topic      string `fig:"topic,required"`
	Publisher  string `fig:"publisher,required"`
	Subscriber string `fig:"subscriber,required"`
}

type AmqpData

type AmqpData struct {
	Topic      string
	Publisher  *amqp.Publisher
	Subscriber *amqp.Subscriber
}

type AwsCfg

type AwsCfg struct {
	Id     string `json:"id"`
	Secret string `json:"secret"`
}

type Config

type Config interface {
	// base
	comfig.Logger
	pgdb.Databaser
	types.Copuser
	comfig.Listenerer

	// other config values
	Telegram() *TelegramCfg
	Amqp() *AmqpData
	JwtParams() *JwtCfg
	RateLimit() *RateLimitCfg
	Runners() *RunnersCfg
	Aws() *AwsCfg

	// Registrator config
	Registrator() RegistratorConfig
}

func New

func New(getter kv.Getter) Config

type JwtCfg

type JwtCfg struct {
	Secret      string `figure:"secret"`
	RefreshLife string `figure:"refresh_life"`
	AccessLife  string `figure:"access_life"`
}

type RateLimitCfg

type RateLimitCfg struct {
	RequestsAmount int64         `fig:"requests_amount,required"`
	TimeLimit      time.Duration `fig:"time_limit,required"`
}

type RegistratorConfig

type RegistratorConfig struct {
	OuterUrl string `fig:"outer_url,required"`
	InnerUrl string `fig:"inner_url,required"`
	Title    string `fig:"title,required"`
	Topic    string `fig:"topic,required"`
	Prefix   string `fig:"prefix,required"`
	IsModule bool   `fig:"is_module,required"`
}

type RunnersCfg

type RunnersCfg struct {
	Registrar time.Duration `fig:"registrar,required"`
	Worker    time.Duration `fig:"worker,required"`
	Receiver  time.Duration `fig:"receiver,required"`
	Sender    time.Duration `fig:"sender,required"`
}

type TelegramCfg

type TelegramCfg struct {
	SuperUser TgData `json:"super_user"`
	User      TgData `json:"user"`
}

type TgData

type TgData struct {
	ApiId       int64  `json:"api_id"`
	ApiHash     string `json:"api_hash"`
	PhoneNumber string `json:"phone_number"`
}

Jump to

Keyboard shortcuts

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