hwebconnector

package
v1.1.44 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DownloadFlag = "FILE-DOWNLOAD"
	PreviewFlag  = "FILE-PREVIEW"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	core.BaseConnector

	App *fiber.App
	//WsConnMap map[string]*websocket.Conn // ws_id: ws
	WsConnMap sync.Map // ws_id: ws
	// contains filtered or unexported fields
}

func New

func New() *Connector

func (*Connector) CloseWsConn added in v1.1.32

func (this *Connector) CloseWsConn(wsID string) (err error)

func (*Connector) Config

func (this *Connector) Config() core.IEntityConf

func (*Connector) EntityStub

func (this *Connector) EntityStub() *core.EntityStub

func (*Connector) HandleFileRequest

func (this *Connector) HandleFileRequest(c *fiber.Ctx, data htypes.Any) (bool, *herrors.Error)

func (*Connector) Name added in v1.1.29

func (this *Connector) Name() string

func (*Connector) Open

func (this *Connector) Open(gw core.IAPIGateway, ins core.IAPIConnector) *herrors.Error

func (*Connector) ParseBodyParams

func (this *Connector) ParseBodyParams(c *fiber.Ctx, ps htypes.Map) *herrors.Error

func (*Connector) ParseFormParams

func (this *Connector) ParseFormParams(c *fiber.Ctx, ps htypes.Map) *herrors.Error

func (*Connector) ParseHeaderParams

func (this *Connector) ParseHeaderParams(c *fiber.Ctx, ps htypes.Map) *herrors.Error

func (*Connector) ParseQueryParams

func (this *Connector) ParseQueryParams(c *fiber.Ctx) (htypes.Map, *herrors.Error)

func (*Connector) SendResponse

func (this *Connector) SendResponse(c *fiber.Ctx, data htypes.Any, err *herrors.Error)

func (*Connector) SendWsResponse added in v1.1.29

func (this *Connector) SendWsResponse(wsID string, data htypes.Any, err *herrors.Error)

type ResponseData

type ResponseData struct {
	Data  htypes.Any     `json:"data"`
	Error *herrors.Error `json:"error"`
}

func NewResponseData

func NewResponseData(data htypes.Any, err *herrors.Error) *ResponseData

type WebConnector

type WebConnector struct {
	core.ConnectorConf

	AppKey           string
	AppSecret        string
	SignMethod       string
	Port             int
	Timeout          int
	BodyLimit        int // Mbit
	Tls              bool
	TlsCertPath      string
	TlsKeyPath       string
	AddressField     string
	WebSocketEnabled bool   // 是否开启websocket
	WsUserField      string // Websocket User字段
	WsTokenField     string // Websocket Token字段

}

Jump to

Keyboard shortcuts

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