api

package
v0.0.0-...-4e8a67a Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Broker *brokerMqtt.Broker
}

API representa a interface da API do servidor

func NewAPI

func NewAPI(broker *brokerMqtt.Broker) *API

Init inicializa a API com as rotas e inicia o servidor

func (*API) Init

func (a *API) Init()

func (*API) MqttTreeHandler

func (a *API) MqttTreeHandler(w http.ResponseWriter, r *http.Request)

func (*API) SessionInfo

func (a *API) SessionInfo(w http.ResponseWriter, r *http.Request)

func (*API) TopicInfoHandler

func (a *API) TopicInfoHandler(w http.ResponseWriter, r *http.Request)

type SessionInfo

type SessionInfo struct {
	NumberSessions int `json:"numberSessions"`
}

type TopicInfo

type TopicInfo struct {
	TopicName    string `json:"topicName"`
	Description  string `json:"description"`
	MessageCount int    `json:"messageCount"`
	Subscribers  int    `json:"subscribers"`
}

type TreeNode

type TreeNode struct {
	Name     string      `json:"name"`
	Topic    string      `json:"topic"`
	Children []*TreeNode `json:"children,omitempty"`
}

Jump to

Keyboard shortcuts

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