config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 13 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"`
	Orchestrator string `fig:"orchestrator,required"`
	Unverified   string `fig:"unverified,required"`
	Publisher    string `fig:"publisher,required"`
	Subscriber   string `fig:"subscriber,required"`
}

type AmqpData

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

type Config

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

	// other config values
	Gitlab() *GitLabCfg
	Amqp() *AmqpData
	JwtParams() *JwtCfg
	RateLimit() *RateLimitCfg
	Runners() *RunnersCfg
	Registrator() RegistratorConfig
}

func New

func New(getter kv.Getter) Config

type GitLabCfg

type GitLabCfg struct {
	SuperToken string `json:"super_token"`
	UsualToken string `json:"usual_token"`
}

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"`
}

Jump to

Keyboard shortcuts

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