global

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: MIT Imports: 9 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IMAGE_PATH = path.Join("data", "images")

Functions

func Check

func Check(err error)

func GetBytes

func GetBytes(url string) ([]byte, error)

func PathExists

func PathExists(path string) bool

func ReadAllText

func ReadAllText(path string) string

func WriteAllText

func WriteAllText(path, text string)

Types

type CQHttpApiConfig

type CQHttpApiConfig struct {
	Host                         string `json:"host"`
	Port                         uint16 `json:"port"`
	UseHttp                      bool   `json:"use_http"`
	WSHost                       string `json:"ws_host"`
	WSPort                       uint16 `json:"ws_port"`
	UseWS                        bool   `json:"use_ws"`
	WSReverseUrl                 string `json:"ws_reverse_url"`
	WSReverseApiUrl              string `json:"ws_reverse_api_url"`
	WSReverseEventUrl            string `json:"ws_reverse_event_url"`
	WSReverseReconnectInterval   uint16 `json:"ws_reverse_reconnect_interval"`
	WSReverseReconnectOnCode1000 bool   `json:"ws_reverse_reconnect_on_code_1000"`
	UseWsReverse                 bool   `json:"use_ws_reverse"`
	PostUrl                      string `json:"post_url"`
	AccessToken                  string `json:"access_token"`
	Secret                       string `json:"secret"`
	PostMessageFormat            string `json:"post_message_format"`
}

type GoCQHttpConfig

type GoCQHttpConfig struct {
	Enabled  bool              `json:"enabled"`
	Host     string            `json:"host"`
	Port     uint16            `json:"port"`
	PostUrls map[string]string `json:"post_urls"`
}

type GoCQReverseWebsocketConfig added in v0.9.2

type GoCQReverseWebsocketConfig struct {
	Enabled                  bool   `json:"enabled"`
	ReverseUrl               string `json:"reverse_url"`
	ReverseApiUrl            string `json:"reverse_api_url"`
	ReverseEventUrl          string `json:"reverse_event_url"`
	ReverseReconnectInterval uint16 `json:"reverse_reconnect_interval"`
}

type GoCQWebsocketConfig

type GoCQWebsocketConfig struct {
	Enabled bool   `json:"enabled"`
	Host    string `json:"host"`
	Port    uint16 `json:"port"`
}

type JsonConfig

type JsonConfig struct {
	Uin            int64                         `json:"uin"`
	Password       string                        `json:"password"`
	EnableDB       bool                          `json:"enable_db"`
	AccessToken    string                        `json:"access_token"`
	ReLogin        bool                          `json:"relogin"`
	ReLoginDelay   int                           `json:"relogin_delay"`
	HttpConfig     *GoCQHttpConfig               `json:"http_config"`
	WSConfig       *GoCQWebsocketConfig          `json:"ws_config"`
	ReverseServers []*GoCQReverseWebsocketConfig `json:"ws_reverse_servers"`
	Debug          bool                          `json:"debug"`
}

func DefaultConfig

func DefaultConfig() *JsonConfig

func Load

func Load(p string) *JsonConfig

func (*JsonConfig) Save

func (c *JsonConfig) Save(p string) error

Jump to

Keyboard shortcuts

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