handler

package
v0.0.0-...-34e25f3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseURL = "/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Port uint `json:"port"`
}

type BaseResponse

type BaseResponse struct {
	// Code http status code
	Code int `json:"code"`
	// Msg responce message
	Msg string `json:"msg"`
	// Data response data
	Data interface{} `json:"data"`
}

type Payload

type Payload struct {
	// Value one row value
	Value []interface{} `json:"value"`
}

type Reader

type Reader interface {
	Read(channel chan []interface{})
}

type ReaderPlugin

type ReaderPlugin struct {
	Base
	Reader
}

func (*ReaderPlugin) GetConn

func (r *ReaderPlugin) GetConn() (*websocket.Conn, error)

GetConn get websocket connect to Push data to writer

func (*ReaderPlugin) Put

func (r *ReaderPlugin) Put(websocketConn *websocket.Conn, channel chan []interface{}) error

Push data to writer and get result

type Writer

type Writer interface {
	Write([]interface{}) BaseResponse
}

Writer Operator interface class for writing data.

type WriterPlugin

type WriterPlugin struct {
	Base `json:",inline"`
	Mode string `json:"mode"`
	Writer
}

func (*WriterPlugin) GetApplication

func (w *WriterPlugin) GetApplication() *gin.Engine

Jump to

Keyboard shortcuts

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