config

package
v0.0.0-...-9514a38 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DBcfg maintains several Database config info
	DBcfg DatabaseConfigModels = make(DatabaseConfigModels)
	// Svccfg is an entry to ServerConfigModel
	Svccfg *ServerConfigModel = &ServerConfigModel{}
)

variables about config

Functions

func Setup

func Setup(svcfgPath string)

Setup is a tool function to setup environment. 1. init app via arapgp.server.json, load DBcfg & Svccfg This exported function need called at the beginning

func Teardown

func Teardown()

Teardown is a tool function to remove config impact

Types

type DatabaseConfigModel

type DatabaseConfigModel struct {
	Host     string
	Port     int
	Username string
	Password string
	Database string
}

DatabaseConfigModel (DBcfg), model of "db" part in arapgp.server.ini

func (*DatabaseConfigModel) Unmarshal

func (cfg *DatabaseConfigModel) Unmarshal(res gjson.Result)

Unmarshal is to implement interface "Unmarshaler"

type DatabaseConfigModels

type DatabaseConfigModels map[string]DatabaseConfigModel

DatabaseConfigModels is map(string => DatabaseConfigModel)

func (DatabaseConfigModels) Unmarshal

func (cfg DatabaseConfigModels) Unmarshal(res gjson.Result)

Unmarshal is to implement interface "Unmarshaler"

type ServerConfigModel

type ServerConfigModel struct {
	Name string
	Host string
	Port int
}

ServerConfigModel (Svccfg), model of "server" part in arapgp.server.ini

func (*ServerConfigModel) Unmarshal

func (cfg *ServerConfigModel) Unmarshal(res gjson.Result)

Unmarshal is to implement interface "Unmarshaler"

Jump to

Keyboard shortcuts

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