config

package
v0.0.0-...-0ce3674 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Cfg = &SonataCfg{
		Server: &ServerCfg{},
		Jwt:    &JwtCfg{},
		Debug:  &DebugCfg{},
	}
)

Functions

func DBDir

func DBDir() string

func LogDir

func LogDir() string

Types

type DebugCfg

type DebugCfg struct {
	Verbose bool `json:"verbose" short:"V" long:"verbose" description:"show verbose debug information"`
	IsMock  bool `json:"mock" short:"m" long:"mock" description:"mock sample data"`
	IsFile  bool `json:"file" short:"f" long:"file" description:"set database as file mode"`
}

type JwtCfg

type JwtCfg struct {
	Key        string            `json:"key" short:"K" long:"key" description:"private key(elliptic P521) to sign JWT token"`
	PrivateKey *ecdsa.PrivateKey `json:"-"`
	PublicKey  *ecdsa.PublicKey  `json:"-"`
}

type ServerCfg

type ServerCfg struct {
	Domain         string   `json:"domain" long:"domain" description:"bind domain" default:"http://127.0.0.1:9999"`
	AllowedOrigins []string `json:"allowedOrigins" long:"allowedOrigins" description:"AllowedOrigins of CORS" default:"*"`
}

type SonataCfg

type SonataCfg struct {
	Server *ServerCfg `json:"server"`
	Jwt    *JwtCfg    `json:"jwt"`
	Debug  *DebugCfg  `json:"debug"`
}

func (*SonataCfg) String

func (s *SonataCfg) String() string

Jump to

Keyboard shortcuts

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