configs

package
v0.0.0-...-b34430a Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AccountService

type AccountService struct {
	Address string `yaml:"address"`
	Port    string `yaml:"port"`
}

func GetConfigGrpcAccountService

func GetConfigGrpcAccountService(c Config) AccountService

type Auth

type Auth struct {
	Domain string `yaml:"domain"`
	Token  Token  `yaml:"token"`
}

func GetConfigAuth

func GetConfigAuth(c Config) Auth

type Cache

type Cache struct {
	Type     CacheType `yaml:"type"`
	Address  string    `yaml:"address"`
	Port     string    `yaml:"port"`
	Username string    `yaml:"username"`
	Password string    `yaml:"password"`
}

func GetConfigCache

func GetConfigCache(c Config) Cache

type CacheType

type CacheType string
const (
	CacheTypeRam   CacheType = "ram"
	CacheTypeRedis CacheType = "redis"
)

type Config

type Config struct {
	Http  Http  `yaml:"http"`
	Auth  Auth  `yaml:"auth"`
	Log   Log   `yaml:"log"`
	Cache Cache `yaml:"cache"`
	Grpc  Grpc  `yaml:"grpc"`
}

func NewConfig

func NewConfig(filePath ConfigFilePath) (Config, error)

Creates a new config instance by reading from a given YAML file. If the filePath is empty, it uses the default embedded configuration.

type ConfigFilePath

type ConfigFilePath string

type Grpc

type Grpc struct {
	AccountService AccountService `yaml:"account_service"`
}

type Http

type Http struct {
	Address string `yaml:"address"`
	Port    string `yaml:"port"`
}

func GetConfigHttp

func GetConfigHttp(c Config) Http

type Log

type Log struct {
	Level string `yaml:"level"`
}

func GetConfigLog

func GetConfigLog(c Config) Log

type Token

type Token struct {
	Secret              string        `yaml:"secret"`
	AccessTokenTTL      time.Duration `yaml:"accessTokenTTL"`
	RefreshTokenLongTTL time.Duration `yaml:"refreshTokenLongTTL"`
	RefreshTokenTTL     time.Duration `yaml:"refreshTokenTTL"`
}

func GetConfigAuthToken

func GetConfigAuthToken(c Config) Token

Jump to

Keyboard shortcuts

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