packetbroker

package
v3.25.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package packetbroker abstracts the Packet Broker Agent to the upstream.Handler interface.

Index

Constants

View Source
const (
	DefaultUpdateGatewayInterval = 10 * time.Minute
	DefaultUpdateGatewayJitter   = 0.2
	DefaultOnlineTTLMargin       = 10 * time.Second
)

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)
	WithClusterAuth() grpc.CallOption
}

Cluster represents the interface the cluster.

type Config added in v3.13.3

type Config struct {
	UpdateInterval  time.Duration
	UpdateJitter    float64
	OnlineTTLMargin time.Duration
	DevAddrPrefixes []types.DevAddrPrefix
	GatewayRegistry GatewayRegistry
	Cluster         Cluster
}

Config configures the Handler.

type GatewayRegistry added in v3.14.0

type GatewayRegistry interface {
	Get(ctx context.Context, req *ttnpb.GetGatewayRequest) (*ttnpb.Gateway, error)
}

GatewayRegistry is a store with gateways.

type Handler

type Handler struct {
	Config
	// contains filtered or unexported fields
}

Handler is the upstream handler.

func NewHandler

func NewHandler(ctx context.Context, config Config) *Handler

NewHandler returns a new upstream handler.

func (*Handler) ConnectGateway

func (h *Handler) ConnectGateway(ctx context.Context, ids *ttnpb.GatewayIdentifiers, conn *io.Connection) error

ConnectGateway implements upstream.Handler.

func (*Handler) DevAddrPrefixes added in v3.13.3

func (h *Handler) DevAddrPrefixes() []types.DevAddrPrefix

DevAddrPrefixes implements upstream.Handler.

func (*Handler) HandleStatus

HandleStatus implements upstream.Handler.

func (*Handler) HandleTxAck added in v3.12.0

HandleTxAck implements upstream.Handler.

HandleUplink implements upstream.Handler.

func (*Handler) Setup

func (h *Handler) Setup(context.Context) error

Setup implements upstream.Handler.

Jump to

Keyboard shortcuts

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