config

package
v0.0.0-...-c266f6d Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommanderConfig

type CommanderConfig struct {
	Port int `yaml:"port"`
}

type Config

type Config struct {
	Name      string                   `yaml:"name"`
	Env       string                   `yaml:"env"`
	Salt      string                   `yaml:"salt"`
	Log       LogConfig                `yaml:"log"`
	Http      HttpConfig               `yaml:"http"`
	Commander CommanderConfig          `yaml:"commander"`
	Redis     RedisConfig              `yaml:"redis"`
	Database  map[string]DbConfig      `yaml:"database"`
	Service   map[string]ServiceConfig `yaml:"service"`
	OAuth     map[string]OAuthConfig   `yaml:"oauth"`
}

func Get

func Get() *Config

func LoadConfig

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

func (*Config) AdminUrl

func (c *Config) AdminUrl() string

func (*Config) GetServiceUrl

func (c *Config) GetServiceUrl(name constant.SvcName) string

func (*Config) IndexUrl

func (c *Config) IndexUrl() string

func (*Config) ServerUrl

func (c *Config) ServerUrl() string

type DbConfig

type DbConfig struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Charset  string `yaml:"charset"`
}

type HttpConfig

type HttpConfig struct {
	Tls  bool   `yaml:"tls"`
	Url  string `yaml:"url"`
	Port int    `yaml:"port"`
}

type LogConfig

type LogConfig struct {
	Level string `yaml:"level"`
	File  string `yaml:"file"`
}

type OAuthConfig

type OAuthConfig struct {
	ClientId     string   `yaml:"clientId"`
	ClientSecret string   `yaml:"clientSecret"`
	Admins       []string `yaml:"admins"`
}

type RedisConfig

type RedisConfig struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Password string `yaml:"password"`
}

type ServiceConfig

type ServiceConfig struct {
	Url string `yaml:"url"`
}

Jump to

Keyboard shortcuts

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