driver

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: GPL-3.0 Imports: 24 Imported by: 30

Documentation

Overview

Package driver provides the default driver of zerobot

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP added in v1.8.2

type HTTP struct {
	URL         string
	AccessToken string
	// contains filtered or unexported fields
}

func NewHTTPClient added in v1.8.2

func NewHTTPClient(url, accessToken, callerURL, callerToken string) *HTTP

func (*HTTP) Connect added in v1.8.2

func (h *HTTP) Connect()

func (*HTTP) Listen added in v1.8.2

func (h *HTTP) Listen(handler func([]byte, zero.APICaller))

Listen 监听 HTTP 请求

type HTTPCaller added in v1.8.2

type HTTPCaller struct {
	URL         string
	AccessToken string
	// contains filtered or unexported fields
}

func (*HTTPCaller) CallAPI added in v1.8.2

func (c *HTTPCaller) CallAPI(ctx context.Context, req zero.APIRequest) (zero.APIResponse, error)

type WSClient added in v1.0.0

type WSClient struct {
	URL         string // ws连接地址
	AccessToken string
	// contains filtered or unexported fields
}

WSClient ...

func NewWebSocketClient added in v1.0.0

func NewWebSocketClient(url, accessToken string) *WSClient

NewWebSocketClient 默认Driver,使用正向WS通信

func (*WSClient) CallAPI added in v1.8.0

func (ws *WSClient) CallAPI(c context.Context, req zero.APIRequest) (zero.APIResponse, error)

CallAPI 发送ws请求

func (*WSClient) Connect added in v1.0.0

func (ws *WSClient) Connect()

Connect 连接ws服务端

func (*WSClient) Listen added in v1.0.0

func (ws *WSClient) Listen(handler func([]byte, zero.APICaller))

Listen 开始监听事件

type WSSCaller added in v1.6.4

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

WSSCaller ...

func (*WSSCaller) CallAPI added in v1.8.0

func (wssc *WSSCaller) CallAPI(c context.Context, req zero.APIRequest) (zero.APIResponse, error)

CallAPI 发送ws请求

type WSServer added in v1.6.4

type WSServer struct {
	URL         string // ws连接地址
	AccessToken string

	json.Unmarshaler
	// contains filtered or unexported fields
}

WSServer ...

func NewWebSocketServer added in v1.6.4

func NewWebSocketServer(waitn int, url, accessToken string) *WSServer

NewWebSocketServer 使用反向WS通信

func (*WSServer) Connect added in v1.6.4

func (wss *WSServer) Connect()

Connect 监听ws服务

func (*WSServer) Listen added in v1.6.4

func (wss *WSServer) Listen(handler func([]byte, zero.APICaller))

Listen 开始监听事件

func (*WSServer) UnmarshalJSON added in v1.7.1

func (wss *WSServer) UnmarshalJSON(data []byte) error

UnmarshalJSON init WSServer with waitn=16

Jump to

Keyboard shortcuts

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