hub

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

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTask

func RunTask(q chan *task, fn func() error) error

Types

type AppConfig

type AppConfig struct {
	UUID     uuid.UUID
	Manifest *catalog.Manifest
	Config   map[string]string `json:"config"`
	Ttl      time.Duration     `json:"ttl"`
}

type Channel

type Channel struct {
	UUID uuid.UUID
	Name string
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(hub *Hub, uuid uuid.UUID, name string, apps []AppConfig) *Channel

type Client

type Client struct {
	SessionID uint32
	UUID      uuid.UUID
	// contains filtered or unexported fields
}

TODO naming here is not quite right. This is really a session or a connection, and ID is really the ClientUUID / connection string, which is either a device ID or a future extension for anonymous subscriptions directly to a channel

func NewClient

func NewClient(clientUUID uuid.UUID, conn *websocket.Conn) *Client

func (*Client) RemoteAddr

func (c *Client) RemoteAddr() net.Addr

func (*Client) String

func (c *Client) String() string

type ClientImage

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

type Hub

type Hub struct {
	Catalog *catalog.Catalog
	// contains filtered or unexported fields
}

func NewHub

func NewHub(store *durable.Store) *Hub

func (*Hub) GetSessions

func (h *Hub) GetSessions() []SessionInfo

func (*Hub) GetWsHandler

func (h *Hub) GetWsHandler() http.HandlerFunc

func (*Hub) ReloadApplets

func (h *Hub) ReloadApplets(channelUUID uuid.UUID, first uuid.UUID) error

func (*Hub) SubscribeDevice

func (h *Hub) SubscribeDevice(deviceUUID uuid.UUID, channelUUID uuid.UUID) error

type SessionInfo

type SessionInfo struct {
	SessionID   uint32
	DeviceUUID  uuid.UUID
	RemoteAddr  string
	ChannelUUID uuid.UUID
	ChannelName string
}

Jump to

Keyboard shortcuts

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