Documentation ¶
Index ¶
- Constants
- type AlertEvent
- type Base64String
- type EventHandler
- type Intrusion
- type MediaPublisher
- type SensorReading
- type Store
- func (s *Store) AlertsPub(ctx context.Context, e AlertEvent) error
- func (s *Store) AlertsSub(ctx context.Context, eh EventHandler) error
- func (s *Store) Close() error
- func (s *Store) DeleteSession(ctx context.Context, id session.ID) error
- func (s *Store) GetSession(ctx context.Context, id session.ID) (session.Session, error)
- func (s *Store) IntrusionPub(ctx context.Context, intrusion Intrusion) error
- func (s *Store) ListSessions(ctx context.Context) ([]session.Session, error)
- func (s *Store) MediaPublisherPub(ctx context.Context, e MediaPublisher) error
- func (s *Store) MediaPublisherSub(ctx context.Context, eh EventHandler) error
- func (s *Store) NewSession(ctx context.Context, userID ulid.ULID, perms session.Permissions, ...) (session.ID, error)
- func (s *Store) ReadingsPub(ctx context.Context, r SensorReading) error
- func (s *Store) ReadingsSub(ctx context.Context, eh EventHandler) error
- type SubFanHandle
Constants ¶
View Source
const IntrusionChannel = iotPrefix + "camera"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertEvent ¶
type Base64String ¶
type Base64String string
func (Base64String) MarshalJSON ¶
func (b Base64String) MarshalJSON() ([]byte, error)
func (*Base64String) UnmarshalJSON ¶
func (b *Base64String) UnmarshalJSON(data []byte) error
type EventHandler ¶
type EventHandler interface {
OnEvent(message rueidis.PubSubMessage)
}
type MediaPublisher ¶
type MediaPublisher struct {
IoTID string `json:"iot_id"`
}
type SensorReading ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AlertsPub ¶
func (s *Store) AlertsPub(ctx context.Context, e AlertEvent) error
AlertsPub publishes an alert event.
func (*Store) AlertsSub ¶
func (s *Store) AlertsSub(ctx context.Context, eh EventHandler) error
AlertsSub blocks and waits for messages on the alerts channel.
func (*Store) DeleteSession ¶
func (*Store) GetSession ¶
func (*Store) IntrusionPub ¶
func (*Store) ListSessions ¶
func (*Store) MediaPublisherPub ¶
func (s *Store) MediaPublisherPub(ctx context.Context, e MediaPublisher) error
func (*Store) MediaPublisherSub ¶
func (s *Store) MediaPublisherSub(ctx context.Context, eh EventHandler) error
func (*Store) NewSession ¶
func (*Store) ReadingsPub ¶
func (s *Store) ReadingsPub(ctx context.Context, r SensorReading) error
func (*Store) ReadingsSub ¶
func (s *Store) ReadingsSub(ctx context.Context, eh EventHandler) error
ReadingsSub blocks and waits for messages on the sensor channel.
type SubFanHandle ¶
type SubFanHandle[T any] struct { // contains filtered or unexported fields }
func NewFan ¶
func NewFan[T any]() *SubFanHandle[T]
NewFan allows to fan out messages to all registered callbacks
func (*SubFanHandle[T]) OnEvent ¶
func (sh *SubFanHandle[T]) OnEvent(message rueidis.PubSubMessage)
func (*SubFanHandle[T]) Unsubscribe ¶
func (sh *SubFanHandle[T]) Unsubscribe(k string)
Click to show internal directories.
Click to hide internal directories.