lastseen

package
v3.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchLastSeenProvider

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

BatchLastSeenProvider represents

func NewBatchLastSeenProvider

func NewBatchLastSeenProvider(ctx context.Context, batchSize int, ticker <-chan time.Time, cluster metadata.ClusterPeerAccess) *BatchLastSeenProvider

NewBatchLastSeenProvider returns a new BatchLastSeenProvider struct.

func (ls *BatchLastSeenProvider) PushLastSeenFromUplink(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers, lastSeen *timestamppb.Timestamp) error

PushLastSeenFromUplink pushes the timestamp of the device uplink to the last seen provider. If the data structure for storing last seen timestamps is full, the timestamps are updated in batch in Identity Server.

type LastSeenProvider

type LastSeenProvider interface {
	PushLastSeenFromUplink(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers, lastSeen *timestamppb.Timestamp) error
}

LastSeenProvider is an interface for storing device last seen timestamp from uplink.

func NewBatchLastSeen

func NewBatchLastSeen(ctx context.Context, batchSize int, ticker <-chan time.Time, cluster metadata.ClusterPeerAccess) (LastSeenProvider, error)

NewBatchLastSeen creates a new BatchLastSeenProvider that manages batch updates of last seen timestamps in Identity Server.

func NewNoopLastSeenProvider

func NewNoopLastSeenProvider() (LastSeenProvider, error)

NewNoopLastSeenProvider returns a noop LastSeenProvider.

Jump to

Keyboard shortcuts

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