conf

package
v0.0.0-...-3d786a4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Environment string // ENVIRONMENT
	DB          *DBEnv
	Server      *ServerEnv
	Data        *DataEnv
	Email       *EmailEnv
}

func Load

func Load(path string) (*Config, error)

type DBEnv

type DBEnv struct {
	NAME     string // DB_NAME
	USER     string // DB_USER
	PASSWORD string // DB_PASSWORD
	HOST     string // DB_HOST
	PORT     int    // DB_PORT
}

func (DBEnv) URL

func (x DBEnv) URL() string

type DataEnv

type DataEnv struct {
	TokenSymmetricKey    string        // TOKEN_SYMMETRIC_KEY
	MeiliSearchMasterKey string        // MEILISEATCH_MASTER_KEY
	AccessTokenDuration  time.Duration // ACCESS_TOKEN_DURATION
	RefreshTokenDuration time.Duration // REFRESH_TOKEN_DURATION
	CacheRepetition      uint8         // CACHE_REPETITION
	CacheKeyDuration     time.Duration // CACHE_KEY_DURATION
	CacheCountDuration   time.Duration // CACHE_COUNT_DURATION
}

type EmailEnv

type EmailEnv struct {
	Name     string // EMAIL_SENDER_NAME
	Address  string // EMAIL_SENDER_ADDRESS
	Password string // EMAIL_SENDER_PASSWORD
}

type ServerEnv

type ServerEnv struct {
	HTTPAddress        *url.URL // HTTP_ADDRESS
	GRPCAddress        *url.URL // GRPC_ADDRESS
	RedisQueueAddress  *url.URL // REDIS_QUEUE_ADDRESS
	RedisCacheAddress  *url.URL // REDIS_CACHE_ADDRESS
	MeilisearchAddress *url.URL // MEILISEATCH_ADDRESS
}

Jump to

Keyboard shortcuts

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