analyticsevents

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: 14 Imported by: 0

Documentation

Index

Constants

View Source
const IdParameterSeperator = "$"

Variables

View Source
var ErrMissingCharacteristicInEvent = errors.New("missing characteristic id in event")

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 Events

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

func New

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

func (*Events) CheckEvent

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

func (*Events) Deploy

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

func (*Events) DeviceGroupsAndImportsEnabled

func (this *Events) DeviceGroupsAndImportsEnabled() bool

func (*Events) GetEventStates

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

func (*Events) Remove

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

func (*Events) UpdateDeviceGroup

func (this *Events) UpdateDeviceGroup(owner string, group model.DeviceGroup) error

Jump to

Keyboard shortcuts

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