Documentation ¶
Index ¶
- Constants
- type ApiChannel
- func NewApiChannel(conf *config.OnebotApiConfig) (ApiChannel, error)
- func NewHttpApiChannel(conf *config.OnebotApiConfig) (ApiChannel, error)
- func NewWebsocketApiChannel(conf *config.OnebotApiConfig) (ApiChannel, error)
- func NewWebsocketReverseApiChannel(conf *config.OnebotApiConfig) (ApiChannel, error)
- type EventChannel
- func NewEventChannel(conf *config.OnebotEventConfig) (EventChannel, error)
- func NewHttpReverseEventChannel(conf *config.OnebotEventConfig) (EventChannel, error)
- func NewWebsocketEventChannel(conf *config.OnebotEventConfig) (EventChannel, error)
- func NewWebsocketReverseEventChannel(conf *config.OnebotEventConfig) (EventChannel, error)
- type HttpChannel
- type HttpReverseEventChannel
- type WebsocketApiChannel
- func (cli *WebsocketApiChannel) Listen(ctx context.Context, callback func(message []byte) error) error
- func (cli *WebsocketApiChannel) Post(action string) error
- func (cli *WebsocketApiChannel) PostByRequest(action string, params interface{}) error
- func (cli *WebsocketApiChannel) PostByRequestForResult(action string, params interface{}, result interface{}) error
- func (cli *WebsocketApiChannel) PostForResult(action string, result interface{}) error
- type WebsocketEventChannel
- type WebsocketReverseApiChannel
- func (cli *WebsocketReverseApiChannel) Post(action string) error
- func (cli *WebsocketReverseApiChannel) PostByRequest(action string, params interface{}) error
- func (cli *WebsocketReverseApiChannel) PostByRequestForResult(action string, params interface{}, result interface{}) error
- func (cli *WebsocketReverseApiChannel) PostForResult(action string, result interface{}) error
- type WebsocketReverseEventChannel
Constants ¶
View Source
const (
// 单位: ms
DEFAULT_TIMEOUT = 10000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiChannel ¶
type ApiChannel interface { Post(url string) error PostForResult(url string, result interface{}) error PostByRequest(url string, req interface{}) error PostByRequestForResult(url string, req, result interface{}) error }
func NewApiChannel ¶
func NewApiChannel(conf *config.OnebotApiConfig) (ApiChannel, error)
func NewHttpApiChannel ¶
func NewHttpApiChannel(conf *config.OnebotApiConfig) (ApiChannel, error)
func NewWebsocketApiChannel ¶
func NewWebsocketApiChannel(conf *config.OnebotApiConfig) (ApiChannel, error)
func NewWebsocketReverseApiChannel ¶
func NewWebsocketReverseApiChannel(conf *config.OnebotApiConfig) (ApiChannel, error)
type EventChannel ¶
func NewEventChannel ¶
func NewEventChannel(conf *config.OnebotEventConfig) (EventChannel, error)
func NewHttpReverseEventChannel ¶
func NewHttpReverseEventChannel(conf *config.OnebotEventConfig) (EventChannel, error)
func NewWebsocketEventChannel ¶
func NewWebsocketEventChannel(conf *config.OnebotEventConfig) (EventChannel, error)
func NewWebsocketReverseEventChannel ¶
func NewWebsocketReverseEventChannel(conf *config.OnebotEventConfig) (EventChannel, error)
type HttpChannel ¶
type HttpChannel struct {
// contains filtered or unexported fields
}
func (*HttpChannel) Post ¶
func (c *HttpChannel) Post(url string) error
func (*HttpChannel) PostByRequest ¶
func (c *HttpChannel) PostByRequest(url string, req interface{}) error
func (*HttpChannel) PostByRequestForResult ¶
func (c *HttpChannel) PostByRequestForResult(url string, req, result interface{}) error
func (*HttpChannel) PostForResult ¶
func (c *HttpChannel) PostForResult(url string, result interface{}) error
type HttpReverseEventChannel ¶
type HttpReverseEventChannel struct {
// contains filtered or unexported fields
}
func (*HttpReverseEventChannel) StartListen ¶
type WebsocketApiChannel ¶
type WebsocketApiChannel struct { Ctx context.Context Conn *websocket.Conn // contains filtered or unexported fields }
func (*WebsocketApiChannel) Post ¶
func (cli *WebsocketApiChannel) Post(action string) error
func (*WebsocketApiChannel) PostByRequest ¶
func (cli *WebsocketApiChannel) PostByRequest(action string, params interface{}) error
func (*WebsocketApiChannel) PostByRequestForResult ¶
func (cli *WebsocketApiChannel) PostByRequestForResult(action string, params interface{}, result interface{}) error
func (*WebsocketApiChannel) PostForResult ¶
func (cli *WebsocketApiChannel) PostForResult(action string, result interface{}) error
type WebsocketEventChannel ¶
type WebsocketEventChannel struct { Conn *websocket.Conn // contains filtered or unexported fields }
func (*WebsocketEventChannel) StartListen ¶
type WebsocketReverseApiChannel ¶
type WebsocketReverseApiChannel struct { Ctx context.Context Conn *websocket.Conn // contains filtered or unexported fields }
func (*WebsocketReverseApiChannel) Post ¶
func (cli *WebsocketReverseApiChannel) Post(action string) error
func (*WebsocketReverseApiChannel) PostByRequest ¶
func (cli *WebsocketReverseApiChannel) PostByRequest(action string, params interface{}) error
func (*WebsocketReverseApiChannel) PostByRequestForResult ¶
func (cli *WebsocketReverseApiChannel) PostByRequestForResult(action string, params interface{}, result interface{}) error
func (*WebsocketReverseApiChannel) PostForResult ¶
func (cli *WebsocketReverseApiChannel) PostForResult(action string, result interface{}) error
type WebsocketReverseEventChannel ¶
type WebsocketReverseEventChannel struct { Conn *websocket.Conn // contains filtered or unexported fields }
func (*WebsocketReverseEventChannel) StartListen ¶
Click to show internal directories.
Click to hide internal directories.