config

package
v0.0.0-...-97b5c88 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CC_HomeDir      = ".chatclient"
	CC_CFG_FileName = "chatclient.json"
)

Variables

This section is empty.

Functions

func GetCCCFGFile

func GetCCCFGFile() string

func GetCCCHomeDir

func GetCCCHomeDir() string

func IsInitialized

func IsInitialized() bool

func IsUserIdentifyReceived

func IsUserIdentifyReceived() bool

func LoadUserIdentify

func LoadUserIdentify()

func SaveUserIdentify

func SaveUserIdentify(sp *protocol.SignPack)

Types

type ChatClientConfig

type ChatClientConfig struct {
	RemoteHttpPort   int    `json:"remotehttpport"`
	RemoteHttpServer string `json:"remotehttpserver"`

	CmdListenPort string `json:"cmdlistenport"`

	RemoteChatPort int `json:"chatport"`

	KeyFile  string `json:"keyfile"`
	UserFile string `json:"userfile"`

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

	SP *protocol.SignPack `json:"-"`

	UpdateFriendTime int64 `json:"updatefriendtime"`

	ChatDataPath   string `json:"chat_data_path"`
	ChatFriendPath string `json:"chat_friend_path"`
	ChatGroupPath  string `json:"chat_group_path"`
	MetaDataPath   string `json:"meta_data_path"`
	ChatGrpKeyPath string `json:"chat_grp_key_path"`

	LastFriendMsg int `json:"last_friend_msg"`
}

func GetCCC

func GetCCC() *ChatClientConfig

func LoadFromCfgFile

func LoadFromCfgFile(file string) *ChatClientConfig

func LoadFromCmd

func LoadFromCmd(initfromcmd func(cmdbc *ChatClientConfig) *ChatClientConfig) *ChatClientConfig

func PreLoad

func PreLoad() *ChatClientConfig

func (*ChatClientConfig) GetAjaxPath

func (bc *ChatClientConfig) GetAjaxPath() string

func (*ChatClientConfig) GetChatFriendPath

func (bc *ChatClientConfig) GetChatFriendPath() string

func (*ChatClientConfig) GetChatGroupPath

func (bc *ChatClientConfig) GetChatGroupPath() string

func (*ChatClientConfig) GetCmdUrl

func (bc *ChatClientConfig) GetCmdUrl() string

func (*ChatClientConfig) GetGrpKeysDbPath

func (bc *ChatClientConfig) GetGrpKeysDbPath() string

func (*ChatClientConfig) GetKeyPath

func (bc *ChatClientConfig) GetKeyPath() string

func (*ChatClientConfig) GetMetaPath

func (bc *ChatClientConfig) GetMetaPath() string

func (*ChatClientConfig) GetRegUrl

func (bc *ChatClientConfig) GetRegUrl() string

func (*ChatClientConfig) GetUserFile

func (bc *ChatClientConfig) GetUserFile() string

func (*ChatClientConfig) InitCfg

func (bc *ChatClientConfig) InitCfg() *ChatClientConfig

func (*ChatClientConfig) Load

func (bc *ChatClientConfig) Load() *ChatClientConfig

func (*ChatClientConfig) Save

func (bc *ChatClientConfig) Save()

type KeyJson

type KeyJson struct {
	PubKey    string `json:"pub_key"`
	CipherKey string `json:"cipher_key"`
}

type UserIdentify

type UserIdentify struct {
	SP protocol.SignPack `json:"sp"`
	KJ KeyJson           `json:"kj"`
}

Jump to

Keyboard shortcuts

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