driver

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: GPL-3.0 Imports: 17 Imported by: 21

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 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.0.0

func (ws *WSClient) CallApi(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.6.4

func (wssc *WSSCaller) CallApi(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