controllers

package
v0.0.0-...-6312dd6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const InstallAddonTimeOut = 60 * time.Second

Variables

This section is empty.

Functions

func NewThingsControllerFunc

func NewThingsControllerFunc(manager ThingsManager, model *container.ThingsContainer) *thingsController

Types

type ActionsController

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

type AddonController

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

func NewAddonController

func NewAddonController(manager AddonManager, m *models.AddonsModel) *AddonController

type AddonManager

type AddonManager interface {
	GetInstallAddons() any
	EnableAddon(addonId string) error
	DisableAddon(addonId string) error
	InstallAddonFromUrl(id, url, checksum string) error
	LoadAddon(id string) error
	UninstallAddon(id string, disabled bool) error
	GetAddonLicense(addonId string) (string, error)
	AddonEnabled(addonId string) bool
	UnloadAddon(addonId string) error
}

type Connection

type Connection struct {
	*websocket.Conn
	// contains filtered or unexported fields
}

type EventsController

type EventsController struct {
}

func NewEventsController

func NewEventsController() *EventsController

type GroupsController

type GroupsController struct {
}

func NewGroupsController

func NewGroupsController() *GroupsController

type JWT

type JWT interface {
	IssueToken(user int64) (string, error)
}

type LoginController

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

func NewLoginController

func NewLoginController(users *models.Users, jsonwebtoken *models.Jsonwebtoken) *LoginController

type Models

type Models struct {
	ThingsModel  *things.Container
	UsersModel   *models.Users
	SettingModel *models.Settings
}

type NewThingsController

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

func NewNewThingsController

func NewNewThingsController(manager manager, thingContainer thingContainer) *NewThingsController

type Router

type Router struct {
	*fiber.App
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(addonUrls []string, manager *addon.Manager, store Storage) *Router

type RulesController

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

func NewRulesController

func NewRulesController(db rules_engine.RuleDB, container things.Container) *RulesController

type SettingsController

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

func NewSettingController

func NewSettingController(model *models.Settings) *SettingsController

type ThingsManager

type ThingsManager interface {
	SetPropertyValue(ctx context.Context, thingId, propertyName string, value any) (any, error)
	GetPropertyValue(thingId, propertyName string) (any, error)
	GetPropertiesValue(thingId string) (map[string]any, error)
	GetMapOfDevices() map[string]*devices.Device
	SetPIN(ctx context.Context, thingId string, pin string) (*messages.Device, error)
	SetCredentials(ctx context.Context, thingId, username, password string) (*messages.Device, error)
}

type UserController

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

func NewUsersController

func NewUsersController(m *models.Users, jwt JWT) *UserController

type Users

type Users interface {
	GetUser(email string) *models.User
}

Jump to

Keyboard shortcuts

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