redis

package
v3.26.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package redis provides Redis implementations of interfaces used by joinserver.

Index

Constants

View Source
const SchemaVersion = 1

SchemaVersion is the Network Server database schema version. Bump when a migration is required.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationActivationSettingRegistry added in v3.10.0

type ApplicationActivationSettingRegistry struct {
	Redis   *ttnredis.Client
	LockTTL time.Duration
}

ApplicationActivationSettingRegistry is an implementation of joinserver.ApplicationActivationSettingRegistry.

func (*ApplicationActivationSettingRegistry) GetByID added in v3.10.0

GetByID gets application activation settings by appID.

func (*ApplicationActivationSettingRegistry) Init added in v3.15.2

Init initializes the ApplicationActivationSettingRegistry.

func (*ApplicationActivationSettingRegistry) Range added in v3.16.0

func (*ApplicationActivationSettingRegistry) SetByID added in v3.10.0

SetByID sets application activation settings by appID.

type DeviceRegistry

type DeviceRegistry struct {
	Redis   *ttnredis.Client
	LockTTL time.Duration
}

DeviceRegistry is an implementation of joinserver.DeviceRegistry.

func (*DeviceRegistry) GetByEUI

func (r *DeviceRegistry) GetByEUI(ctx context.Context, joinEUI, devEUI types.EUI64, paths []string) (*ttnpb.ContextualEndDevice, error)

GetByEUI gets device by joinEUI, devEUI.

func (*DeviceRegistry) GetByID

func (r *DeviceRegistry) GetByID(ctx context.Context, appID *ttnpb.ApplicationIdentifiers, devID string, paths []string) (*ttnpb.EndDevice, error)

GetByID gets device by appID, devID.

func (*DeviceRegistry) Init added in v3.15.2

func (r *DeviceRegistry) Init(ctx context.Context) error

Init initializes the DeviceRegistry.

func (*DeviceRegistry) RangeByID added in v3.16.0

func (*DeviceRegistry) SetByEUI

func (r *DeviceRegistry) SetByEUI(ctx context.Context, joinEUI types.EUI64, devEUI types.EUI64, gets []string, f func(context.Context, *ttnpb.EndDevice) (*ttnpb.EndDevice, []string, error)) (*ttnpb.ContextualEndDevice, error)

SetByEUI sets device by joinEUI, devEUI. SetByEUI will only succeed if the device is set via SetByID first.

func (*DeviceRegistry) SetByID

func (r *DeviceRegistry) SetByID(ctx context.Context, appID *ttnpb.ApplicationIdentifiers, devID string, gets []string, f func(pb *ttnpb.EndDevice) (*ttnpb.EndDevice, []string, error)) (*ttnpb.EndDevice, error)

SetByID sets device by appID, devID.

type KeyRegistry

type KeyRegistry struct {
	Redis   *ttnredis.Client
	LockTTL time.Duration
	// Limit is the maximum number of session keys to store per JoinEUI and DevEUI combination.
	Limit int
}

KeyRegistry is an implementation of joinserver.KeyRegistry.

func (*KeyRegistry) Delete added in v3.18.0

func (r *KeyRegistry) Delete(ctx context.Context, joinEUI, devEUI types.EUI64) error

func (*KeyRegistry) GetByID

func (r *KeyRegistry) GetByID(ctx context.Context, joinEUI, devEUI types.EUI64, id []byte, paths []string) (*ttnpb.SessionKeys, error)

GetByID gets session keys by joinEUI, devEUI, id.

func (*KeyRegistry) Init added in v3.15.2

func (r *KeyRegistry) Init(ctx context.Context) error

Init initializes the KeyRegistry.

func (*KeyRegistry) SetByID

func (r *KeyRegistry) SetByID(ctx context.Context, joinEUI, devEUI types.EUI64, id []byte, gets []string, f func(*ttnpb.SessionKeys) (*ttnpb.SessionKeys, []string, error)) (*ttnpb.SessionKeys, error)

SetByID sets session keys by joinEUI, devEUI, id.

Jump to

Keyboard shortcuts

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