server

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: AGPL-3.0 Imports: 35 Imported by: 3

Documentation

Overview

Package server 包含HTTP,WebSocket,反向WebSocket请求处理的相关函数与结构体

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Daemon added in v1.0.0

func Daemon()

Daemon go-cqhttp server 的 daemon的实现函数

Types

type HTTPClient added in v1.0.0

type HTTPClient struct {
	MaxRetries      uint64
	RetriesInterval uint64
	// contains filtered or unexported fields
}

HTTPClient 反向HTTP上报客户端

func (HTTPClient) Run added in v1.0.0

func (c HTTPClient) Run()

Run 运行反向HTTP服务

type HTTPServer added in v1.0.0

type HTTPServer struct {
	Disabled    bool   `yaml:"disabled"`
	Version     uint16 `yaml:"version"`
	Address     string `yaml:"address"`
	Host        string `yaml:"host"`
	Port        int    `yaml:"port"`
	Timeout     int32  `yaml:"timeout"`
	LongPolling struct {
		Enabled      bool `yaml:"enabled"`
		MaxQueueSize int  `yaml:"max-queue-size"`
	} `yaml:"long-polling"`
	Post []httpServerPost `yaml:"post"`

	MiddleWares `yaml:"middlewares"`
}

HTTPServer HTTP通信相关配置

type LambdaServer added in v1.0.0

type LambdaServer struct {
	Disabled bool   `yaml:"disabled"`
	Type     string `yaml:"type"`

	MiddleWares `yaml:"middlewares"`
}

LambdaServer 云函数配置

type MiddleWares added in v1.0.0

type MiddleWares struct {
	AccessToken string `yaml:"access-token"`
	Filter      string `yaml:"filter"`
	RateLimit   struct {
		Enabled   bool    `yaml:"enabled"`
		Frequency float64 `yaml:"frequency"`
		Bucket    int     `yaml:"bucket"`
	} `yaml:"rate-limit"`
}

MiddleWares 通信中间件

type WebsocketReverse added in v1.0.0

type WebsocketReverse struct {
	Disabled          bool   `yaml:"disabled"`
	Universal         string `yaml:"universal"`
	API               string `yaml:"api"`
	Event             string `yaml:"event"`
	ReconnectInterval int    `yaml:"reconnect-interval"`

	MiddleWares `yaml:"middlewares"`
}

WebsocketReverse 反向WS相关配置

type WebsocketServer

type WebsocketServer struct {
	Disabled bool   `yaml:"disabled"`
	Address  string `yaml:"address"`
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`

	MiddleWares `yaml:"middlewares"`
}

WebsocketServer 正向WS相关配置

Jump to

Keyboard shortcuts

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