config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(configFile *string)

Types

type Config

type Config struct {
	JWT      JWTConfig      `yaml:"jwt"`
	Server   ServerConfig   `yaml:"server"`
	Database DatabaseConfig `yaml:"database"`
	Redis    RedisConfig    `yaml:"redis"`
}
var Conf *Config

func (*Config) GetDbURI

func (c *Config) GetDbURI() string

func (*Config) GetJWTPublicKey

func (c *Config) GetJWTPublicKey() interface{}

func (*Config) GetJWTRefreshSigningKey

func (c *Config) GetJWTRefreshSigningKey() interface{}

func (*Config) GetJWTSigningKey

func (c *Config) GetJWTSigningKey() interface{}

type DatabaseConfig

type DatabaseConfig struct {
	Host          string `yaml:"host" envconfig:"CSERVICE_DB_HOST"`
	Port          uint   `yaml:"port" envconfig:"CSERVICE_DB_PORT"`
	Username      string `yaml:"username" envconfig:"CSERVICE_DB_USERNAME"`
	Password      string `yaml:"password" envconfig:"CSERVICE_DB_PASSWORD"`
	Name          string `yaml:"name" envconfig:"CSERVICE_DB_NAME"`
	AutoMigration bool   `yaml:"auto_migration" envconfig:"CSERVICE_DB_AUTOMIGRATION"`
}

type JWTConfig

type JWTConfig struct {
	SigningMethod     string `yaml:"signing_method" envconfig:"CSERVICE_JWT_SIGNING_METHOD"`
	SigningKey        string `yaml:"signing_key" envconfig:"CSERVICE_JWT_SIGNING_KEY"`
	PublicKey         string `yaml:"public_key,omitempty" envconfig:"CSERVICE_JWT_PUBLIC_KEY"`
	RefreshSigningKey string `yaml:"refresh_signing_key" envconfig:"CSERVICE_JWT_REFRESH_SIGNING_KEY"`
	RefreshPublicKey  string `yaml:"refresh_public_key,omitempty" envconfig:"CSERVICE_JWT_REFRESH_PUBLIC_KEY"`
}

type RedisConfig

type RedisConfig struct {
	Host              string `yaml:"host" envconfig:"CSERVICE_REDIS_HOST"`
	Port              uint   `yaml:"port" envconfig:"CSERVICE_REDIS_PORT"`
	Password          string `yaml:"password" envconfig:"CSERVICE_REDIS_PASSWORD"`
	Database          int    `yaml:"database" envconfig:"CSERVICE_REDIS_DATABASE"`
	EnableMultiLogout bool   `yaml:"enable_multi_logout" envconfig:"CSERVICE_REDIS_ENABLE_MULTI_LOGOUT"`
}

type ServerConfig

type ServerConfig struct {
	Host      string `yaml:"host" envconfig:"CSERVICE_SERVER_HOST"`
	Port      string `yaml:"port" envconfig:"CSERVICE_SERVER_PORT"`
	ApiPrefix string `yaml:"api_prefix" envconfig:"CSERVICE_SERVER_API_PREFIX"`
}

Jump to

Keyboard shortcuts

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