web

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPWhiteList

func IPWhiteList(whitelist map[string]bool) gin.HandlerFunc

Types

type SocketInstance

type SocketInstance struct {
	WebServer *WebServerInstance

	Context        *gin.Context
	Dependencies   *controller.Dependencies
	ShouldSendInfo bool
	// contains filtered or unexported fields
}

func NewSocketInstance

func NewSocketInstance(webServer *WebServerInstance, uuid uuid.UUID, c *gin.Context, dep *controller.Dependencies) SocketInstance

func (*SocketInstance) SendInfo

func (inst *SocketInstance) SendInfo()

func (*SocketInstance) SendJSON

func (inst *SocketInstance) SendJSON(v interface{})

func (*SocketInstance) SendTemperatures added in v1.0.6

func (inst *SocketInstance) SendTemperatures(temps thermal.Temperatures)

type SocketMessage

type SocketMessage struct {
	ID       string `json:"id"`
	Category int    `json:"category"`
	Action   int    `json:"action"`
	Value    string `json:"value"`
}

type WebServerInstance

type WebServerInstance struct {
	WebServer       *gin.Engine
	SocketInstances map[uuid.UUID]*SocketInstance
	Dependencies    *controller.Dependencies
	IsLooping       bool
}

func NewWebServer

func NewWebServer(dep *controller.Dependencies) *WebServerInstance

func (*WebServerInstance) BroadcastInfo

func (webInst *WebServerInstance) BroadcastInfo()

func (*WebServerInstance) BroadcastJSON

func (webInst *WebServerInstance) BroadcastJSON(v interface{})

func (*WebServerInstance) StartLoop added in v1.0.6

func (webInst *WebServerInstance) StartLoop()

Jump to

Keyboard shortcuts

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