events

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factory = &EventsFactory{}

Functions

func GetUserId

func GetUserId(token string) (userId string, err error)

func IsAdmin

func IsAdmin(token string) bool

Types

type Claims

type Claims struct {
	Sub         string              `json:"sub,omitempty"`
	RealmAccess map[string][]string `json:"realm_access,omitempty"`
}

func (*Claims) Valid

func (this *Claims) Valid() error

type DeviceGroupCommand

type DeviceGroupCommand struct {
	Command     string            `json:"command"`
	Id          string            `json:"id"`
	Owner       string            `json:"owner"`
	DeviceGroup model.DeviceGroup `json:"device_group"`
}

type DoneNotification

type DoneNotification struct {
	Command string `json:"command"`
	Id      string `json:"id"`
	Handler string `json:"handler"`
}

type Events

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

func (*Events) CheckEvent

func (this *Events) CheckEvent(token string, id string) (result int)

func (*Events) Deploy

func (this *Events) Deploy(owner string, deployment deploymentmodel.Deployment) (err error)

func (*Events) GetEventStates

func (this *Events) GetEventStates(token string, ids []string) (states map[string]bool, err error, code int)

func (*Events) HandleCommand

func (this *Events) HandleCommand(msg []byte) error

func (*Events) HandleDeviceGroupUpdate

func (this *Events) HandleDeviceGroupUpdate(msg []byte) error

func (*Events) Remove

func (this *Events) Remove(owner string, deploymentId string) (err error)

type EventsFactory

type EventsFactory struct{}

func (*EventsFactory) New

func (this *EventsFactory) New(ctx context.Context, config config.Config, analytics interfaces.Analytics, devices interfaces.Devices, imports interfaces.Imports, doneProducer interfaces.Producer, m *metrics.Metrics) (result interfaces.Events, err error)

type Handler

type Handler interface {
	GetEventStates(token string, ids []string) (states map[string]bool, err error, code int)
	CheckEvent(token string, id string) int
	Remove(owner string, deploymentId string) error
	Deploy(owner string, deployment deploymentmodel.Deployment) error
	UpdateDeviceGroup(owner string, group model.DeviceGroup) error
}

type VersionWrapper

type VersionWrapper struct {
	Command string `json:"command"`
	Id      string `json:"id"`
	Version int64  `json:"version"`
	Owner   string `json:"owner"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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