config

package
v0.0.0-...-7a3883e Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerMain          = "app"
	TemplateViewPath    = "../templates"
	TemplateViewEndfix  = ".html"
	TemplateMainView    = "index.html"
	Favicon             = "../assets/favicon.ico"
	StaticRoute         = "/static"
	StaticAssets        = "../assets/static"
	UploadFileDirectory = "../uploads"
	DefaultMongoDBName  = "guest"
)

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type DBRestfulConfig

type DBRestfulConfig struct {
	API      string                 `yaml:"api"`
	Enabled  bool                   `yaml:"enabled"`
	TLS      definations.TLSOptions `yaml:"tls"`
	UserName string                 `yaml:"username"`
	Password string                 `yaml:"password"`
}

DBRestfulConfig config block

type DefaultACL

type DefaultACL struct {
	ID     string `yaml:"id"`
	Name   string `yaml:"name"`
	AppKey string `yaml:"appKey"`
}

DefaultACL config block

type Env

type Env struct {
	MQs           map[string]mqenv.MQConnectorConfig         `yaml:"mq"`
	Caches        map[string]cachingenv.CacheConnectorConfig `yaml:"cache"`
	DBs           map[string]definations.DBConnectorConfig   `yaml:"db"`
	DBRestfuls    map[string]DBRestfulConfig                 `yaml:"restful"`
	Logger        logger.Logger                              `yaml:"logger"`
	Server        Server                                     `yaml:"server"`
	DefaultAcls   []DefaultACL                               `yaml:"defaultAcl"`
	RestfulLoader RestfulLoader                              `yaml:"restLoader"`
	Proxies       *definations.Proxies                       `yaml:"proxies"`
	HealthzChecks []HealthzChecks                            `yaml:"healthzChecks"`
	Properties    map[string]string                          `yaml:"properties"`
	Extends       map[string][]map[string]string             `yaml:"extends"`
}

Env config block

func GetEnv

func GetEnv() *Env

GetEnv getter

func Init

func Init(filePath string) (*Env, error)

Init initializer

type HealthzChecks

type HealthzChecks struct {
	Name      string   `yaml:"name"`
	Type      string   `yaml:"type"`
	Endpoints []string `yaml:"endpoints"`
}

HealthzChecks config block

type RestfulLoader

type RestfulLoader struct {
	Enabled bool                   `yaml:"enabled"`
	Address string                 `yaml:"address"`
	AppIds  []string               `yaml:"appId"`
	TLS     definations.TLSOptions `yaml:"tls"`
}

RestfulLoader config block

type Server

type Server struct {
	Host       string                 `yaml:"host"`
	Port       int                    `yaml:"port"`
	Scheme     string                 `yaml:"scheme"`
	WhiteList  []string               `yaml:"whiteList"`
	TLS        definations.TLSOptions `yaml:"tls"`
	DeployAddr string                 `yaml:"depoyAddr"`
	Dev        bool                   `yaml:"dev"`
	DevAddr    string                 `yaml:"devAddr"`
	PprofPort  int                    `yaml:"pprofPort"`
}

Server config block

func (Server) FormatCallbackURL

func (n Server) FormatCallbackURL(uri string) string

FormatCallbackURL formatter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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