config

package
v0.0.0-...-0c44e78 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(filename string) (*viper.Viper, error)

Types

type Config

type Config struct {
	App         appconfig.App
	HTTP        HTTP
	GRPC        GRPC
	Postgres    Postgres
	Migration   Migration
	RpcEnpoints RpcEndpoints `mapstructure:"rpcEndpoints"`
	Kafka       Kafka
	LocalCache  LocalCache `mapstructure:"localCache"`
	RedisCache  RedisCache `mapstructure:"redisCache"`
}

func ParseConfig

func ParseConfig(v *viper.Viper) (*Config, error)

type CuckooFilter

type CuckooFilter struct {
	Capacity      int64
	BucketSize    int64
	MaxIterations int64
}

type GRPC

type GRPC struct {
	Port              string
	Time              time.Duration
	Timeout           time.Duration
	MaxConnectionIdle time.Duration
	MaxConnectionAge  time.Duration
}

type HTTP

type HTTP struct {
	Port string
	Mode string
}

type Kafka

type Kafka struct {
	Brokers []string
}

type LocalCache

type LocalCache struct {
	ExpirationTime uint64
}

type Migration

type Migration struct {
	Enable   bool
	Recreate bool
}

type Postgres

type Postgres struct {
	DnsURL string `mapstructure:"DNS_URL"`
}

type RedisCache

type RedisCache struct {
	Address        []string
	Password       string
	DB             int
	PoolSize       int
	MaxRetries     int
	ExpirationTime uint64
	CuckooFilter   CuckooFilter `mapstructure:"CuckooFilter"`
}

type RpcEndpoints

type RpcEndpoints struct {
	AuthSvc    string
	ProductSvc string
}

Jump to

Keyboard shortcuts

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