Documentation
¶
Overview ¶
Package config loads config data from file or creates the file if it does not exist.
Overview ¶
Types with a New method are meant to be used to load/save program config.
Types without a New method are meant to be embedded or used in another config struct.
If you make any changes in the config within the program, you must then use the MustUpdate method.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcctSrv ¶
AcctSrv is the config interface for WAN server.
func NewAcctSrv ¶
func NewAcctSrv() AcctSrv
NewAcctSrv creates acctsrv with saved or default values.
func (*AcctSrv) MustUpdate ¶
func (as *AcctSrv) MustUpdate()
MustUpdate saves config, panics on fail.
type Connect ¶
Connect base config interface to connect. This type is to be embedded or used in a config struct.
func (*Connect) ConnectionStr ¶
ConnectionStr returns a string from the Connect type.
func (*Connect) MustOpenDatabase ¶
MustOpenDatabase returns pointer to an sql.DB, panics on fail.
Usage:
db := cn.MustOpenDatabase() defer db.close()
type ConsoleClient ¶
ConsoleClient contains all config data to start program.
func NewConsoleClient ¶
func NewConsoleClient() ConsoleClient
NewConsoleClient creates ConsoleClient with saved or default values.
func (*ConsoleClient) MustUpdate ¶
func (cc *ConsoleClient) MustUpdate()
MustUpdate saves config, panics on fail.
type GameSrv ¶
gameserver config interface for LAN server.
func NewGameSrv ¶
func NewGameSrv() GameSrv
NewGameSrv creates gameserver with saved or default values.
func (*GameSrv) MustUpdate ¶
func (gs *GameSrv) MustUpdate()
MustUpdate saves config, panics on fail.
type GuiClient ¶
guiclient contains all config data to start program.
func NewGuiClient ¶
func NewGuiClient() GuiClient
NewGuiClient creates guiclient with saved or default values.
func (*GuiClient) MustUpdate ¶
func (gc *GuiClient) MustUpdate()
MustUpdate saves config, panics on fail.
type Owner ¶
type Owner struct { Id uint64 // 'toml:"OwnerId"' // contains filtered or unexported fields }
Owner base config interface for clients. This type is to be embedded or used in a config struct.
type Ports ¶
Ports base config interface for server io. This type is to be embedded or used in a config struct.
type Server ¶
Server base config interface to find server. This type is to be embedded or used in a config struct.
type Service ¶
Type Service embeds Cert and Port.
type TestSrv ¶
TestSrv config interface for test server.
func NewTestSrv ¶
func NewTestSrv() TestSrv
NewTestSrv creates TestSrv with saved or default values.
func (*TestSrv) MustUpdate ¶
func (ts *TestSrv) MustUpdate()
MustUpdate saves config, panics on fail.
type WebClient ¶
ConsoleClient contains all config data to start program.
func NewWebClient ¶
func NewWebClient() WebClient
NewWebClient creates webclient with saved or default values.
func (*WebClient) MustUpdate ¶
func (wc *WebClient) MustUpdate()
MustUpdate saves config, panics on fail.