gateways

package
v3.32.2 Latest Latest
Warning

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

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

Documentation

Overview

Package gateways provide gateway registry functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	GetPeerConn(ctx context.Context, role ttnpb.ClusterRole, ids cluster.EntityIdentifiers) (*grpc.ClientConn, error)
	AllowInsecureForCredentials() bool
	WithClusterAuth() grpc.CallOption
}

Cluster provides cluster operations.

type GatewayRegistry

type GatewayRegistry interface {
	// AssertGatewayRights checks whether the gateway authentication
	// (provided in the context) contains the required rights.
	AssertGatewayRights(ctx context.Context, ids *ttnpb.GatewayIdentifiers, required ...ttnpb.Right) error
	// GetIdentifiersForEUI returns the gateway identifiers for the EUI.
	GetIdentifiersForEUI(ctx context.Context, eui types.EUI64) (*ttnpb.GatewayIdentifiers, error)
	// Create creates a gateway.
	Create(ctx context.Context, in *ttnpb.CreateGatewayRequest) (*ttnpb.Gateway, error)
	// Delete the gateway. This may not release the gateway ID for reuse, but it does release the EUI.
	Delete(ctx context.Context, in *ttnpb.GatewayIdentifiers) (*emptypb.Empty, error)
	// Get the gateway. This may not release the gateway ID for reuse, but it does release the EUI.
	Get(ctx context.Context, req *ttnpb.GetGatewayRequest) (*ttnpb.Gateway, error)
}

GatewayRegistry abstracts the entity registry's gateway functions.

type Registry

type Registry struct {
	Cluster
}

Registry implements GatewayRegistry.

func (Registry) AssertGatewayRights

func (Registry) AssertGatewayRights(
	ctx context.Context,
	ids *ttnpb.GatewayIdentifiers,
	required ...ttnpb.Right,
) error

AssertGatewayRights implements GatewayRegistry.

func (Registry) Create

Create implements GatewayRegistry.

func (Registry) Delete

func (reg Registry) Delete(ctx context.Context, req *ttnpb.GatewayIdentifiers) (*emptypb.Empty, error)

Delete implements GatewayRegistry.

func (Registry) Get

Get implements GatewayRegistry.

func (Registry) GetIdentifiersForEUI

func (reg Registry) GetIdentifiersForEUI(
	ctx context.Context,
	gatewayEUI types.EUI64,
) (*ttnpb.GatewayIdentifiers, error)

GetIdentifiersForEUI implements GatewayRegistry.

Jump to

Keyboard shortcuts

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