temp

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package temp implements temporary storage interfaces that will be valid only during runtime and will evaporate after shutdown of program.

Index

Constants

This section is empty.

Variables

View Source
var ErrContextDone = errors.New("temp: context is done, performed graceful shutdown")

Functions

This section is empty.

Types

type OnlineUsers

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

func NewOnlineUsers

func NewOnlineUsers() *OnlineUsers

func (*OnlineUsers) All

func (o *OnlineUsers) All(ctx context.Context) ([]string, error)

func (*OnlineUsers) IsOnline

func (o *OnlineUsers) IsOnline(ctx context.Context, id string) (bool, error)

func (*OnlineUsers) Update

func (o *OnlineUsers) Update(ctx context.Context, ids []string) error

type StatusTx

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

StatusTx implements storage.StatusTx interface for temporary in memory storage.

func NewStatusTx

func NewStatusTx() *StatusTx

NewStatusTx is the only one safe constructor for StatusTx.

func (*StatusTx) DevicesStatus

func (s *StatusTx) DevicesStatus(ctx context.Context, f func(context.Context, storage.Status) error) error

DevicesStatus accepts function that manipulates number of unknown devices and online users in single safe transaction.

Jump to

Keyboard shortcuts

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