config

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvPrefix = "CHANNEL_TRANSFER"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel added in v0.0.6

type Channel struct {
	Name         string        `mapstructure:"name" validate:"required"`
	TaskExecutor *TaskExecutor `mapstructure:"taskExecutor"`
}

type Config

type Config struct {
	LogLevel    string `mapstructure:"logLevel" validate:"required"`
	LogType     string `mapstructure:"logType" validate:"required"`
	ProfilePath string `mapstructure:"profilePath" validate:"required"`
	UserName    string `mapstructure:"userName" validate:"required"`

	ListenAPI    *ListenAPI    `mapstructure:"listenAPI"`
	RedisStorage *RedisStorage `mapstructure:"redisStorage" validate:"required"`
	Service      *Service      `mapstructure:"service" validate:"required"`
	PromMetrics  *PromMetrics  `mapstructure:"promMetrics"`

	Channels []Channel `mapstructure:"channels" validate:"required,dive,required"`

	Options Options `mapstructure:"options" validate:"required"`
}

func GetConfig

func GetConfig() (*Config, error)

func (Config) WithoutSensitiveData

func (c Config) WithoutSensitiveData() Config

WithoutSensitiveData returns copy of config with empty sensitive data. This config might be used for trace logging.

type ListenAPI

type ListenAPI struct {
	AccessToken string `mapstructure:"accessToken"`
	AddressHTTP string `mapstructure:"addressHTTP" validate:"required"`
	AddressGRPC string `mapstructure:"addressGRPC" validate:"required"`
	// contains filtered or unexported fields
}

func (*ListenAPI) TLSConfig

func (api *ListenAPI) TLSConfig() *tls.Config

type Options

type Options struct {
	BatchTxPreimagePrefix         string         `mapstructure:"batchTxPreimagePrefix"  validate:"required"`
	CollectorsBufSize             uint           `mapstructure:"collectorsBufSize" validate:"required"`
	ExecuteTimeout                *time.Duration `mapstructure:"executeTimeout"`
	RetryExecuteAttempts          uint           `mapstructure:"retryExecuteAttempts" validate:"required"`
	RetryExecuteMaxDelay          *time.Duration `mapstructure:"retryExecuteMaxDelay"`
	RetryExecuteDelay             *time.Duration `mapstructure:"retryExecuteDelay"`
	TTL                           *time.Duration `mapstructure:"ttl"`
	TransfersInHandleOnChannel    uint           `mapstructure:"transfersInHandleOnChannel" validate:"required"`
	NewestRequestStreamBufferSize uint           `mapstructure:"newestRequestStreamBufferSize" validate:"required"`
}

func (Options) EffExecuteTimeout

func (eo Options) EffExecuteTimeout(defOpts Options) (time.Duration, error)

func (Options) EffRetryExecuteDelay

func (eo Options) EffRetryExecuteDelay(defOpts Options) (time.Duration, error)

func (Options) EffRetryExecuteMaxDelay

func (eo Options) EffRetryExecuteMaxDelay(defOpts Options) (time.Duration, error)

func (Options) EffTTL

func (eo Options) EffTTL(defOpts Options) (time.Duration, error)

type PromMetrics

type PromMetrics struct {
	PrefixForMetrics string `mapstructure:"prefix"`
}

type RedisStorage

type RedisStorage struct {
	Addr                []string       `mapstructure:"addr" validate:"required,dive,required"`
	Password            string         `mapstructure:"password"`
	DBPrefix            string         `mapstructure:"dbPrefix" validate:"required"`
	AfterTransferTTL    *time.Duration `mapstructure:"afterTransferTTL" validate:"required"`
	CACert              string         `mapstructure:"caCert,omitempty"`
	TLSHostnameOverride string         `mapstructure:"tlsHostnameOverride,omitempty"`
	ClientKey           string         `mapstructure:"clientKey,omitempty"`
	ClientCert          string         `mapstructure:"clientCert,omitempty"`
	// contains filtered or unexported fields
}

func (*RedisStorage) EffAfterTransferTTL

func (rs *RedisStorage) EffAfterTransferTTL(cfg RedisStorage) (time.Duration, error)

func (*RedisStorage) TLSConfig

func (rs *RedisStorage) TLSConfig() *tls.Config

type Service

type Service struct {
	Address string `mapstructure:"address" validate:"required"`
	// contains filtered or unexported fields
}

func (*Service) TLSConfig

func (api *Service) TLSConfig() *tls.Config

type TaskExecutor added in v0.0.6

type TaskExecutor struct {
	AddressGRPC string `mapstructure:"addressGRPC" validate:"required"`
	// contains filtered or unexported fields
}

func (*TaskExecutor) TLSConfig added in v0.0.6

func (b *TaskExecutor) TLSConfig() *tls.Config

Jump to

Keyboard shortcuts

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