config

package
v0.0.0-...-3cc3e56 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBInited = false
View Source
var DBSet = make(dBSet)

Functions

func InitDBSet

func InitDBSet(c *Config, logger *logrus.Logger) error

Types

type Config

type Config struct {
	// Storage Storage
	AutoMigrate bool   `json:"autoMigrate"`
	EnableTest  bool   `json:"enableTest"`
	Log         string `json:"log"`
	Server      Server
	Proxy       []Proxy
}
var (
	G   run.Group
	Cfg *Config
)

func ReadConfigFile

func ReadConfigFile(configFile string) (*Config, error)

type Proxy

type Proxy struct {
	Name    string  `json:"name"`
	Desc    string  `json:"desc"`
	Storage Storage `json:"storage"`
}

type Server

type Server struct {
	HTTP           string   `json:"http"`
	HTTPS          string   `json:"https"`
	Prefix         string   `json:"prefix"`
	TLSCert        string   `json:"tlsCert"`
	TLSKey         string   `json:"tlsKey"`
	AllowedOrigins []string `json:"allowedOrigins"`
}

type Storage

type Storage struct {
	Type   string     `json:"type"`
	Config db.Storage `json:"config"`
}

func (*Storage) UnmarshalJSON

func (s *Storage) UnmarshalJSON(b []byte) error

UnmarshalJSON allows Storage to implement the unmarshaler interface to dynamically determine the type of the storage config.

Jump to

Keyboard shortcuts

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