packages

package
v3.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationPackageHandler

ApplicationPackageHandler handles upstream traffic from the Application Server.

type AssociationRegistry added in v3.9.0

type AssociationRegistry interface {
	// GetAssociation returns the association by its identifiers.
	GetAssociation(ctx context.Context, ids *ttnpb.ApplicationPackageAssociationIdentifiers, paths []string) (*ttnpb.ApplicationPackageAssociation, error)
	// ListAssociations returns all of the associations of the end device.
	ListAssociations(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers, paths []string) ([]*ttnpb.ApplicationPackageAssociation, error)
	// SetAssociation creates, updates or deletes the association by its identifiers.
	SetAssociation(ctx context.Context, ids *ttnpb.ApplicationPackageAssociationIdentifiers, gets []string, f func(*ttnpb.ApplicationPackageAssociation) (*ttnpb.ApplicationPackageAssociation, []string, error)) (*ttnpb.ApplicationPackageAssociation, error)
	// WithPagination adds the pagination information to the context.
	WithPagination(ctx context.Context, limit, page uint32, total *int64) context.Context
}

AssociationRegistry is a registry for application package end device associations.

type Config added in v3.9.2

type Config struct {
	Workers int           `name:"workers" description:"Number of workers per application package"`
	Timeout time.Duration `name:"timeout" description:"Message processing timeout"`
}

Config contains configuration options for application packages.

type DefaultAssociationRegistry added in v3.9.0

type DefaultAssociationRegistry interface {
	// GetDefaultAssociation returns the default association by its identifiers.
	GetDefaultAssociation(ctx context.Context, ids *ttnpb.ApplicationPackageDefaultAssociationIdentifiers, paths []string) (*ttnpb.ApplicationPackageDefaultAssociation, error)
	// ListDefaultAssociation returns all of the default associations of the application.
	ListDefaultAssociations(ctx context.Context, ids *ttnpb.ApplicationIdentifiers, paths []string) ([]*ttnpb.ApplicationPackageDefaultAssociation, error)
	// SetDefaultAssociation creates, updates or deletes the default association by its identifiers.
	SetDefaultAssociation(ctx context.Context, ids *ttnpb.ApplicationPackageDefaultAssociationIdentifiers, gets []string, f func(*ttnpb.ApplicationPackageDefaultAssociation) (*ttnpb.ApplicationPackageDefaultAssociation, []string, error)) (*ttnpb.ApplicationPackageDefaultAssociation, error)
	// WithPagination adds the pagination information to the context.
	WithPagination(ctx context.Context, limit, page uint32, total *int64) context.Context
}

DefaultAssociationRegistry is a registry for application package default associations.

type Registry

type Registry interface {
	AssociationRegistry
	DefaultAssociationRegistry
	TransactionRegistry
	// Range ranges over the application packages and calls the appropriate callback function, until false is returned.
	Range(
		ctx context.Context, paths []string,
		devFunc func(context.Context, ttnpb.EndDeviceIdentifiers, *ttnpb.ApplicationPackageAssociation) bool,
		appFunc func(context.Context, ttnpb.ApplicationIdentifiers, *ttnpb.ApplicationPackageDefaultAssociation) bool,
	) error
}

Registry is a registry for application packages.

type RegistryCleaner added in v3.15.2

type RegistryCleaner struct {
	ApplicationPackagesRegistry Registry
	LocalDeviceSet              map[string]struct{}
	LocalApplicationSet         map[string]struct{}
}

RegistryCleaner is a service responsible for cleanup of the application packages registry.

func (*RegistryCleaner) CleanData added in v3.15.2

func (cleaner *RegistryCleaner) CleanData(ctx context.Context, isDeviceSet map[string]struct{}, isApplicationSet map[string]struct{}) error

CleanData cleans registry application and device data.

func (*RegistryCleaner) DeleteApplicationAndDeviceData added in v3.15.2

func (cleaner *RegistryCleaner) DeleteApplicationAndDeviceData(ctx context.Context, deviceList, applicationList []string) error

DeleteApplicationAndDeviceData deletes registry application and device data of all applications and devices in application and device lists.

func (*RegistryCleaner) RangeToLocalSet added in v3.15.2

func (cleaner *RegistryCleaner) RangeToLocalSet(ctx context.Context) error

RangeToLocalSet returns a set of applications and devices that have data in the registry.

type Server

type Server interface {
	rpcserver.ServiceRegisterer
	web.Registerer
}

Server is an application packages frontend.

func New

func New(ctx context.Context, as io.Server, registry Registry, handlers map[string]ApplicationPackageHandler, workers int, timeout time.Duration) (Server, error)

New returns an application packages server wrapping the given registries and handlers.

type TransactionRegistry added in v3.14.1

type TransactionRegistry interface {
	EndDeviceTransaction(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers, fPort uint32, packageName string, fn func(ctx context.Context) error) error
}

TransactionRegistry is a registry for application packages transactions.

Directories

Path Synopsis
loradms
v1
loragls
v3

Jump to

Keyboard shortcuts

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