config

package
v0.0.0-...-dc1a94a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CS_HomeDir      = ".chatserver"
	CS_CFG_FileName = "chatserver.json"
)

Variables

This section is empty.

Functions

func GetCSCFGFile

func GetCSCFGFile() string

func GetCSCHomeDir

func GetCSCHomeDir() string

func IsInitialized

func IsInitialized() bool

Types

type ChatServerConfig

type ChatServerConfig struct {
	MgtHttpPort int `json:"mgthttpport"`

	CmdListenPort string `json:"cmdlistenport"`

	DBPath          string `json:"dbpath"`
	UsersDBFile     string `json:"usersdbfile"`
	FriendsDBFile   string `json:"friendsdbfile"`
	GroupsDBFile    string `json:"groupsdbfile"`
	GrpMemberDBFile string `json:"grpmemberdbfile"`
	GroupKeysDbFile string `json:"groupkeysdbfile"`
	GroupMsgDbPath  string `json:"groupmsgdbpath"`
	P2PMsgDbPath    string `json:"p2pmsgdbpath"`

	ChatListenPort int `json:"chatport"`
	//ChatMgmtPort   int			`json:"chatmgmtport"`
	KeyFile string `json:"keyfile"`

	PrivKey ed25519.PrivateKey `json:"-"`
	PubKey  ed25519.PublicKey  `json:"-"`
}

func GetCSC

func GetCSC() *ChatServerConfig

func LoadFromCfgFile

func LoadFromCfgFile(file string) *ChatServerConfig

func LoadFromCmd

func LoadFromCmd(initfromcmd func(cmdbc *ChatServerConfig) *ChatServerConfig) *ChatServerConfig

func PreLoad

func PreLoad() *ChatServerConfig

func (*ChatServerConfig) GetFriendsDbPath

func (bc *ChatServerConfig) GetFriendsDbPath() string

func (*ChatServerConfig) GetGroupMsgDbPath

func (bc *ChatServerConfig) GetGroupMsgDbPath() string

func (*ChatServerConfig) GetGroupsDbPath

func (bc *ChatServerConfig) GetGroupsDbPath() string

func (*ChatServerConfig) GetGrpKeysDbPath

func (bc *ChatServerConfig) GetGrpKeysDbPath() string

func (*ChatServerConfig) GetGrpMbrsDbPath

func (bc *ChatServerConfig) GetGrpMbrsDbPath() string

func (*ChatServerConfig) GetKeyPath

func (bc *ChatServerConfig) GetKeyPath() string

func (*ChatServerConfig) GetP2PMsgDbPath

func (bc *ChatServerConfig) GetP2PMsgDbPath() string

func (*ChatServerConfig) GetUsersDbPath

func (bc *ChatServerConfig) GetUsersDbPath() string

func (*ChatServerConfig) InitCfg

func (bc *ChatServerConfig) InitCfg() *ChatServerConfig

func (*ChatServerConfig) Load

func (bc *ChatServerConfig) Load() *ChatServerConfig

func (*ChatServerConfig) Save

func (bc *ChatServerConfig) Save()

Jump to

Keyboard shortcuts

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