rpc

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgTypeStatus    = "status"
	MsgTypeException = "exception"
	MsgTypeStartUp   = "startup"

	MsgTypeEntry  = "entry"
	MsgTypeExit   = "exit"
	MsgTypeMarket = "market"
)

Variables

This section is empty.

Functions

func CleanUp

func CleanUp()

func InitRPC

func InitRPC() *errs.Error

func SendMsg

func SendMsg(msg map[string]interface{})

func TrySendExc

func TrySendExc(cacheKey string, content string)

Types

type ExcEncoder

type ExcEncoder struct {
	*log.TextEncoder
}

func (*ExcEncoder) Clone

func (e *ExcEncoder) Clone() *ExcEncoder

func (*ExcEncoder) EncodeEntry

func (e *ExcEncoder) EncodeEntry(ent zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error)

type ExcNotify

type ExcNotify struct {
	zapcore.LevelEnabler
	// contains filtered or unexported fields
}

func NewExcNotify

func NewExcNotify() *ExcNotify

func (*ExcNotify) Check

func (*ExcNotify) Sync

func (h *ExcNotify) Sync() error

func (*ExcNotify) With

func (h *ExcNotify) With(fields []zapcore.Field) zapcore.Core

func (*ExcNotify) Write

func (h *ExcNotify) Write(ent zapcore.Entry, fields []zapcore.Field) error

type IWebHook

type IWebHook interface {
	GetName() string
	IsDisable() bool
	SetDisable(val bool)
	CleanUp()
	/*
		Send a message, payload is the data to be sent after msg rendering
			发送消息,payload是msg渲染后的待发送数据
	*/
	SendMsg(msgType string, account string, payload map[string]string) bool
	ConsumeForever()
}

type WeCred

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

type WeWork

type WeWork struct {
	*WebHook
	// contains filtered or unexported fields
}

func NewWeWork

func NewWeWork(name string, item map[string]interface{}) *WeWork

type WeWorkATRes

type WeWorkATRes struct {
	WeWorkRes
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
}

type WeWorkRes

type WeWorkRes struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

type WeWorkSendRes

type WeWorkSendRes struct {
	WeWorkRes
	InvalidUser    string `json:"invaliduser"`
	InvalidParty   string `json:"invalidparty"`
	InvalidTag     string `json:"invalidtag"`
	UnlicensedUser string `json:"unlicenseduser"`
	Msgid          string `json:"msgid"`
	ResponseCode   string `json:"response_code"`
}

type WebHook

type WebHook struct {
	Config   map[string]interface{}
	MsgTypes map[string]bool
	Accounts map[string]bool
	Queue    chan map[string]string
	// contains filtered or unexported fields
}

func NewWebHook

func NewWebHook(name string, item map[string]interface{}) *WebHook

func (*WebHook) CleanUp

func (h *WebHook) CleanUp()

func (*WebHook) ConsumeForever

func (h *WebHook) ConsumeForever()

func (*WebHook) GetName

func (h *WebHook) GetName() string

func (*WebHook) IsDisable

func (h *WebHook) IsDisable() bool

func (*WebHook) SendMsg

func (h *WebHook) SendMsg(msgType string, account string, payload map[string]string) bool

func (*WebHook) SetDisable

func (h *WebHook) SetDisable(val bool)

Jump to

Keyboard shortcuts

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