models

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker added in v0.0.17

type Broker struct {
	// contains filtered or unexported fields
}

func NewBroker added in v0.0.17

func NewBroker(address string, brokerPort, wsPort int) (b *Broker, err error)

func (*Broker) Publish added in v0.0.17

func (b *Broker) Publish(topic string, payload any) (err error)

func (*Broker) ServeWS added in v0.0.17

func (b *Broker) ServeWS(w http.ResponseWriter, r *http.Request)

func (*Broker) Subscribe added in v0.0.17

func (b *Broker) Subscribe(topic string, cb func(msg MQTTMessage)) error

type Context

type Context struct {
	// contains filtered or unexported fields
}

func (*Context) GetParameter

func (c *Context) GetParameter(key string) string

func (*Context) GetRequest

func (c *Context) GetRequest() *http.Request

func (*Context) GetResponseWriter

func (c *Context) GetResponseWriter() http.ResponseWriter

func (*Context) RespondJson

func (c *Context) RespondJson(statusCode int, data any)

func (*Context) RespondString

func (c *Context) RespondString(s string)

func (*Context) SetParameters

func (c *Context) SetParameters(p map[string]string)

func (*Context) SetRequest

func (c *Context) SetRequest(r *http.Request)

func (*Context) SetResponseWriter

func (c *Context) SetResponseWriter(w http.ResponseWriter)

type Group

type Group struct {
	Path  string
	Route *Route
}

func (*Group) Delete added in v0.0.15

func (g *Group) Delete(path string, handler Handler)

func (*Group) Get

func (g *Group) Get(path string, handler Handler)

func (*Group) Group

func (g *Group) Group(path string) *Group

func (*Group) Post

func (g *Group) Post(path string, handler Handler)

func (*Group) Put added in v0.0.15

func (g *Group) Put(path string, handler Handler)

func (*Group) Update added in v0.0.15

func (g *Group) Update(path string, handler Handler)

type Handler

type Handler func(ctx Context)

type MQTTMessage added in v0.0.17

type MQTTMessage struct {
	ID            string `json:"uuid,omitempty"`
	RemoteAddress string `json:"remoteAddress,omitempty"`
	Topic         string `json:"topic"`
	Payload       string `json:"payload"`
}

type Route

type Route struct {
	// contains filtered or unexported fields
}

func (*Route) Insert

func (n *Route) Insert(method, path string, handler Handler)

func (*Route) Search

func (n *Route) Search(method, path string) (bool, Handler, map[string]string)

type WSClient added in v0.0.16

type WSClient struct {
	// contains filtered or unexported fields
}

func (*WSClient) Answer added in v0.0.16

func (ws *WSClient) Answer(messageType int, data []byte)

func (*WSClient) Listen added in v0.0.16

func (ws *WSClient) Listen(cb func(data any))

func (*WSClient) Recieve added in v0.0.16

func (ws *WSClient) Recieve(data any)

func (*WSClient) SetConnection added in v0.0.16

func (ws *WSClient) SetConnection(conn *websocket.Conn)

Jump to

Keyboard shortcuts

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