dbconfig

package
v2.1.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBufferSize  = 1024
	DefaultHTTPTimeout = 10 * time.Second
	DefaultTCPTimeout  = 10 * time.Second
)

Variables

View Source
var (
	DefaultTCPServer  string
	DefaultHTTPServer string
)

Functions

This section is empty.

Types

type ConfigDB

type ConfigDB struct {
	// contains filtered or unexported fields
}

func OpenOrCreate

func OpenOrCreate(filePath string, np *jww.Notepad) (db *ConfigDB, err error)

func (*ConfigDB) Close

func (d *ConfigDB) Close()

func (*ConfigDB) GetHttpApiConfig

func (d *ConfigDB) GetHttpApiConfig() (cfg HttpApiConfig, err error)

func (*ConfigDB) GetTcpApiConfig

func (d *ConfigDB) GetTcpApiConfig() (cfg TcpApiConfig, err error)

func (*ConfigDB) GetUserInfo

func (d *ConfigDB) GetUserInfo() (info UserInfo, err error)

func (*ConfigDB) UpdateHttpApiConfig

func (d *ConfigDB) UpdateHttpApiConfig(cfg HttpApiConfig) error

func (*ConfigDB) UpdateTcpApiConfig

func (d *ConfigDB) UpdateTcpApiConfig(cfg TcpApiConfig) error

func (*ConfigDB) UpdateUserInfo

func (d *ConfigDB) UpdateUserInfo(info UserInfo) error

type HttpApiConfig

type HttpApiConfig struct {
	Server  string        `mapconv:"server"`
	Timeout time.Duration `mapconv:"timeout"`
}

type TcpApiConfig

type TcpApiConfig struct {
	Address    string        `mapconv:"address"`
	BufferSize int           `mapconv:"buffersize"`
	Timeout    time.Duration `mapconv:"timeout"`
}

type UserInfo

type UserInfo struct {
	Token     string `mapconv:"token"`
	Namespace string `mapconv:"namespace"`
}

Jump to

Keyboard shortcuts

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