store

package
v2.25.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DevicesSubscriptionQuery

type DevicesSubscriptionQuery struct {
	SubscriptionID string
	LastCheck      time.Time
}

type Store

type Store interface {
	SaveSubscription(ctx context.Context, sub Subscription) error
	PopSubscription(ctx context.Context, subscriptionID string) (Subscription, error)
	LoadSubscriptions(ctx context.Context, query SubscriptionQuery, h SubscriptionHandler) error
	IncrementSubscriptionSequenceNumber(ctx context.Context, subscriptionID string) (uint64, error)
	SetInitialized(ctx context.Context, subscriptionID string) error
}

type Subscription

type Subscription struct {
	ID             string // Id
	URL            string // href
	CorrelationID  string // uuid
	Type           Type
	Accept         []string // application/json or application/vnd.ocf+cbor
	EventTypes     events.EventTypes
	DeviceID       string // filled for device and resource events
	Href           string // filled for resource events
	SequenceNumber uint64
	SigningSecret  string
	Initialized    bool // need to send initialize events
	AccessToken    string
}

type SubscriptionHandler

type SubscriptionHandler interface {
	Handle(ctx context.Context, iter SubscriptionIter) (err error)
}

type SubscriptionIter

type SubscriptionIter interface {
	Next(ctx context.Context, sub *Subscription) bool
	Err() error
}

type SubscriptionQuery

type SubscriptionQuery struct {
	SubscriptionID string
	DeviceID       string
	Href           string
	Type           Type
}

type Type

type Type string
const (
	Type_Devices  Type = "devices"
	Type_Device   Type = "device"
	Type_Resource Type = "resource"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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