ws

package
v1.23.8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Build = func(topic string, logic Logic) server.Handler {
	return func(ctx server.Context) {
		handleWsSession(ctx, topic, logic)
	}
}
View Source
var RestFunc func(rj *RestJob, respPtr any) error

Functions

This section is empty.

Types

type Conn

type Conn struct {
	C *websocket.Conn
}

type Downstream

type Downstream struct {
	Channel  string `json:"channel,omitempty"`  // 接收者通道
	Category string `json:"category,omitempty"` // 类型: mq/api
	Payload  any    `json:"payload,omitempty"`  // 数据
}

type Logic

type Logic func(data any, txHandler TxHandler)

type RestJob

type RestJob struct {
	Api     string            `json:"api,omitempty"`
	Schema  string            `json:"schema,omitempty"`
	Method  string            `json:"method,omitempty"`
	Host    string            `json:"host,omitempty"`
	Path    string            `json:"path,omitempty"`
	Query   map[string]string `json:"query,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`
	Cookies map[string]string `json:"cookies,omitempty"`
}

func (*RestJob) Fetch

func (rj *RestJob) Fetch(respPtr any) (err error)

type TxHandler

type TxHandler func(channel string, category string, payload any)

Jump to

Keyboard shortcuts

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