config

package
v0.0.0-...-71a6408 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RdsKeyVersion = "rdm_version"  // hset no xx url xxx.com
	RdsKeyQaId    = "rdm_aQaId"    // inc [RdsKeyQaId]
	RdsKeyQa      = "rdm_zQa"      // zadd [RdsKeyQa] [inc RdsKeyQaId] [data.Qa]
	RdsKeyQaReply = "rdm_zQaReply" // zadd [RdsKeyQa] [inc RdsKeyQaId] [data.QaReply]
)
View Source
const (
	VERSION     = 10
	VERSION_STR = "0.0.1"
)

Variables

View Source
var (
	ApiSyncConfig        = ApiHost + "/Api/SyncConfig"
	ApiQaList            = ApiHost + "/Api/QaList"
	ApiQaReplyList       = ApiHost + "/Api/QaReplyList/%s"
	ApiQaAdd             = ApiHost + "/Api/QaAdd"
	ApiQaReply           = ApiHost + "/Api/QaReply"
	ApiUserLogin         = ApiHost + "/Api/UserLogin"
	ApiUserRegister      = ApiHost + "/Api/UserRegister"
	ApiUserPasswordReset = ApiHost + "/Api/UserPasswordReset"
	ApiChatHistory       = ApiHost + "/Api/ChatHistory"
	ApiChatUsers         = ApiHost + "/Api/Users"
	ApiVersion           = ApiHost + "/Api/Version"
	ApiStatistic         = ApiHost + "/Api/Statistic"
)
View Source
var ApiHost = "http://47.96.235.53:9393"

Functions

This section is empty.

Types

type ApiReturn

type ApiReturn struct {
	Code   int
	Msg    string
	Result interface{}
}

type ApiUrl

type ApiUrl struct {
	UrlForDocument string // 文档地址
	UrlForNotice   string // 公告地址
	UrlForJoke     string // 选项地址
}

type Arguments

type Arguments struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Optional string `json:"optional"`
	Enum     string `json:"enum"`
}

type Cmds

type Cmds struct {
	Cmd     []string
	Summary []string
}

type Config

type Config struct {
	Email    string // 用户名
	Nickname string // 用户名
	Token    string // 加密key

	Connections []RedisClient // redis链接

	ApiUrl ApiUrl
	UiConf UiConf
}

func NewConfig

func NewConfig() *Config

func (*Config) AppendRds

func (conf *Config) AppendRds(rc ...RedisClient)

func (*Config) RemoveRds

func (conf *Config) RemoveRds(addr string)

func (*Config) Save

func (conf *Config) Save()

type RedisClient

type RedisClient struct {
	Client   *redis.Client `json:"-"`
	Addr     string
	Password string
	DB       int
	Title    string
}
{
 "Username": "",
 "Token": "",
 "DefaultWindowSize": {
   "Width": 1300,
   "Height": 80
 },
 "Connections": [
   {
     "Addr": "",
     "Password": "",
     "DB": 0
   }
 ],
 "Theme": "dark",
 "Document": "",
 "Notice": ""
}

type RedisCmd

type RedisCmd struct {
	CmdName    string
	Summary    string      `json:"summary"`
	Complexity string      `json:"complexity"`
	Since      string      `json:"since"`
	Group      string      `json:"group"`
	Arguments  interface{} `json:"arguments"`
}

type UiConf

type UiConf struct {
	LimitKey          int64
	LimitContent      int64
	ContentMode       string    // view / edit
	DefaultWindowSize fyne.Size // 窗口默认大小
	Theme             string    // dark,light
	DefaultPage       string    // Home
	DefaultRdm        string    // Command
}

type Version

type Version struct {
	Platform string
}

Jump to

Keyboard shortcuts

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