configs

package
v0.0.0-...-32396ae Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 3 Imported by: 14

Documentation

Index

Constants

View Source
const (
	DefaultGrpcPort          = "44044"
	DefaultWalletServicePort = "40404"
	DefaultPostgresPort      = "5432"
	DefaultTokenExpire       = time.Hour * 24
	DefaultCacheExpire       = time.Minute
	DefaultENV               = "local"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigDB

type ConfigDB struct {
	DBHost     string
	DBPort     string
	DBUser     string
	DBPassword string
	DBName     string
	DBSSLMode  string
}

ConfigDB holds the configuration settings for the PostgreSQL database connection.

func NewConfigDB

func NewConfigDB(dbHost, dbPort, dbUser, dbPassword, dbName, dbSSLMode, serverPort string) *ConfigDB

NewConfigDB creates a new ConfigDB instance with the provided values.

func NewEnvConfigDB

func NewEnvConfigDB(configPath string) *ConfigDB

NewEnvConfigDB loads configuration from a .env file and returns a ConfigDB instance.

type Server

type Server struct {
	ServerName string
	Port       string
	Host       string
}

type ServerConfig

type ServerConfig struct {
	Env         string
	TokenExpire string
	CacheExpire string
	Servers     map[string]Server
}

func NewServerConfig

func NewServerConfig(env, tokenExp, cacheExp string, servers ...Server) *ServerConfig

func NewServerEnvConfig

func NewServerEnvConfig(configPath string) *ServerConfig

Jump to

Keyboard shortcuts

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