mock

package
v0.0.0-...-60b8695 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Frontend

type Frontend struct {
	Up     chan *ttnpb.UplinkMessage
	Status chan *ttnpb.GatewayStatus
	TxAck  chan *ttnpb.TxAcknowledgment
	Down   chan *ttnpb.DownlinkMessage
}

Frontend is a mock front-end.

func ConnectFrontend

func ConnectFrontend(ctx context.Context, ids ttnpb.GatewayIdentifiers, server io.Server) (*Frontend, error)

ConnectFrontend connects a new mock front-end to the given server. The gateway time starts at Unix epoch.

func (*Frontend) Protocol

func (*Frontend) Protocol() string

func (*Frontend) SupportsDownlinkClaim

func (*Frontend) SupportsDownlinkClaim() bool

type IdentityServer

type IdentityServer struct {
	ttnpb.GatewayRegistryServer
	ttnpb.GatewayAccessServer
	// contains filtered or unexported fields
}

IdentityServer is the mock IS for GS tests.

func NewIS

func NewIS(ctx context.Context) (*IdentityServer, string)

NewIS creates and starts an instance of the IS.

func (*IdentityServer) Add

Add adds a new gateway.

func (*IdentityServer) Get

Get retrives the Gateway.

func (*IdentityServer) ListRights

func (is *IdentityServer) ListRights(ctx context.Context, ids *ttnpb.GatewayIdentifiers) (res *ttnpb.Rights, err error)

ListRights lists the rights from context for a particular gateway.

type Server

type Server interface {
	io.Server

	HasDownlinkClaim(context.Context, ttnpb.GatewayIdentifiers) bool
	RegisterGateway(ctx context.Context, ids ttnpb.GatewayIdentifiers, gateway *ttnpb.Gateway)
	GetConnection(ctx context.Context, ids ttnpb.GatewayIdentifiers) *io.Connection
	Connections() <-chan *io.Connection
}

Server represents a testing io.Server.

func NewServer

func NewServer(c *component.Component) Server

NewServer instantiates a new Server.

Jump to

Keyboard shortcuts

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