mock

package
v3.28.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayServer

type GatewayServer struct {
	ttnpb.UnimplementedNsGsServer

	*component.Component
	Downlink chan *ttnpb.DownlinkMessage
}

GatewayServer is a mock Gateway Server.

func NewGatewayServer

func NewGatewayServer(c *component.Component) (*GatewayServer, error)

NewGatewayServer returns a new GatewayServer.

func (*GatewayServer) Publish

Publish publishes the given message to Packet Broker Agent in the cluster.

func (*GatewayServer) RegisterHandlers

func (gs *GatewayServer) RegisterHandlers(s *runtime.ServeMux, conn *grpc.ClientConn)

RegisterHandlers implements rpcserver.Registerer.

func (*GatewayServer) RegisterServices

func (gs *GatewayServer) RegisterServices(s *grpc.Server)

RegisterServices implements rpcserver.Registerer.

func (*GatewayServer) Roles

func (gs *GatewayServer) Roles() []ttnpb.ClusterRole

Roles implements rpcserver.Registerer.

ScheduleDownlink implements ttnpb.NsGsServer.

func (*GatewayServer) UpdateGateway added in v3.13.3

UpdateGateway updates the gateway in Packet Broker Agent in the cluster.

type NetworkServer

type NetworkServer struct {
	ttnpb.UnimplementedGsNsServer

	*component.Component
	Uplink chan *ttnpb.UplinkMessage
	TxAck  chan *ttnpb.GatewayTxAcknowledgment
}

NetworkServer is a mock Network Server.

func NewNetworkServer

func NewNetworkServer(c *component.Component) (*NetworkServer, error)

NewNetworkServer returns a new NetworkServer.

func (ns *NetworkServer) HandleUplink(ctx context.Context, req *ttnpb.UplinkMessage) (*emptypb.Empty, error)

HandleUplink implements ttnpb.GsNsServer.

func (*NetworkServer) Publish

func (ns *NetworkServer) Publish(ctx context.Context, down *ttnpb.DownlinkMessage) error

Publish publishes the given message to Packet Broker Agent in the cluster.

func (*NetworkServer) RegisterHandlers

func (ns *NetworkServer) RegisterHandlers(s *runtime.ServeMux, conn *grpc.ClientConn)

RegisterHandlers implements rpcserver.Registerer.

func (*NetworkServer) RegisterServices

func (ns *NetworkServer) RegisterServices(s *grpc.Server)

RegisterServices implements rpcserver.Registerer.

func (*NetworkServer) ReportTxAcknowledgment added in v3.12.0

func (ns *NetworkServer) ReportTxAcknowledgment(_ context.Context, req *ttnpb.GatewayTxAcknowledgment) (*emptypb.Empty, error)

ReportTxAcknowledgment implements ttnpb.GsNsServer.

func (*NetworkServer) Roles

func (ns *NetworkServer) Roles() []ttnpb.ClusterRole

Roles implements rpcserver.Registerer.

type PBControlPlane added in v3.12.0

type PBControlPlane struct {
	routingpb.UnimplementedPolicyManagerServer

	*grpc.Server
	ListDefaultPoliciesHandler     func(ctx context.Context, req *routingpb.ListDefaultPoliciesRequest) (*routingpb.ListDefaultPoliciesResponse, error)
	GetDefaultPolicyHandler        func(ctx context.Context, req *routingpb.GetDefaultPolicyRequest) (*routingpb.GetPolicyResponse, error)
	SetDefaultPolicyHandler        func(ctx context.Context, req *routingpb.SetPolicyRequest) (*emptypb.Empty, error)
	ListHomeNetworkPoliciesHandler func(ctx context.Context, req *routingpb.ListHomeNetworkPoliciesRequest) (*routingpb.ListHomeNetworkPoliciesResponse, error)
	GetHomeNetworkPolicyHandler    func(ctx context.Context, req *routingpb.GetHomeNetworkPolicyRequest) (*routingpb.GetPolicyResponse, error)
	SetHomeNetworkPolicyHandler    func(ctx context.Context, req *routingpb.SetPolicyRequest) (*emptypb.Empty, error)
	ListEffectivePoliciesHandler   func(ctx context.Context, req *routingpb.ListEffectivePoliciesRequest) (*routingpb.ListEffectivePoliciesResponse, error)
	ListNetworksWithPolicyHandler  func(ctx context.Context, req *routingpb.ListNetworksWithPolicyRequest) (*routingpb.ListNetworksResponse, error)
}

PBControlPlane is a mock Packet Broker Control Plane.

func NewPBControlPlane added in v3.12.0

func NewPBControlPlane(tb testing.TB) *PBControlPlane

NewPBControlPlane instantiates a new mock Packet Broker Control Plane.

func (*PBControlPlane) GetDefaultPolicy added in v3.12.0

func (*PBControlPlane) GetHomeNetworkPolicy added in v3.12.0

func (*PBControlPlane) ListDefaultPolicies added in v3.12.0

func (*PBControlPlane) ListEffectivePolicies added in v3.12.0

func (*PBControlPlane) ListHomeNetworkPolicies added in v3.12.0

func (*PBControlPlane) ListNetworksWithPolicy added in v3.13.0

func (*PBControlPlane) SetDefaultPolicy added in v3.12.0

func (s *PBControlPlane) SetDefaultPolicy(ctx context.Context, req *routingpb.SetPolicyRequest) (*emptypb.Empty, error)

func (*PBControlPlane) SetHomeNetworkPolicy added in v3.12.0

func (s *PBControlPlane) SetHomeNetworkPolicy(ctx context.Context, req *routingpb.SetPolicyRequest) (*emptypb.Empty, error)

type PBDataPlane

type PBDataPlane struct {
	*grpc.Server
	ForwarderUp              chan *packetbroker.RoutedUplinkMessage
	ForwarderDown            chan *packetbroker.RoutedDownlinkMessage
	ForwarderDownStateChange chan *packetbroker.DownlinkMessageDeliveryStateChange
	HomeNetworkDown          chan *packetbroker.RoutedDownlinkMessage
	HomeNetworkUp            chan *packetbroker.RoutedUplinkMessage
	HomeNetworkUpStateChange chan *packetbroker.UplinkMessageDeliveryStateChange
}

PBDataPlane is a mock Packet Broker Data Plane.

func NewPBDataPlane

func NewPBDataPlane(tb testing.TB) *PBDataPlane

NewPBDataPlane instantiates a new mock Packet Broker Data Plane.

type PBIAM added in v3.12.0

type PBIAM struct {
	*grpc.Server
	Registry struct {
		ListNetworksHandler  func(ctx context.Context, req *iampb.ListNetworksRequest) (*iampb.ListNetworksResponse, error)
		CreateNetworkHandler func(ctx context.Context, req *iampb.CreateNetworkRequest) (*iampb.CreateNetworkResponse, error)
		GetNetworkHandler    func(ctx context.Context, req *iampb.NetworkRequest) (*iampb.GetNetworkResponse, error)
		UpdateNetworkHandler func(ctx context.Context, req *iampb.UpdateNetworkRequest) (*emptypb.Empty, error)
		DeleteNetworkHandler func(ctx context.Context, req *iampb.NetworkRequest) (*emptypb.Empty, error)
		ListTenantsHandler   func(ctx context.Context, req *iampb.ListTenantsRequest) (*iampb.ListTenantsResponse, error)
		CreateTenantHandler  func(ctx context.Context, req *iampb.CreateTenantRequest) (*iampb.CreateTenantResponse, error)
		GetTenantHandler     func(ctx context.Context, req *iampb.TenantRequest) (*iampb.GetTenantResponse, error)
		UpdateTenantHandler  func(ctx context.Context, req *iampb.UpdateTenantRequest) (*emptypb.Empty, error)
		DeleteTenantHandler  func(ctx context.Context, req *iampb.TenantRequest) (*emptypb.Empty, error)
	}
	Catalog struct {
		ListNetworksHandler     func(ctx context.Context, req *iampbv2.ListNetworksRequest) (*iampbv2.ListNetworksResponse, error)
		ListHomeNetworksHandler func(ctx context.Context, req *iampbv2.ListNetworksRequest) (*iampbv2.ListNetworksResponse, error)
		ListJoinServersHandler  func(ctx context.Context, req *iampbv2.ListJoinServersRequest) (*iampbv2.ListJoinServersResponse, error)
	}
}

PBIAM is a mock Packet Broker IAM.

func NewPBIAM added in v3.12.0

func NewPBIAM(tb testing.TB) *PBIAM

NewPBIAM instantiates a new mock Packet Broker IAM.

type PBMapper added in v3.13.3

type PBMapper struct {
	*grpc.Server
	UpdateGatewayHandler func(ctx context.Context, in *mappingpb.UpdateGatewayRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

PBMapper is a mock Packet Broker Mapper.

func NewPBMapper added in v3.13.3

func NewPBMapper(tb testing.TB) *PBMapper

NewPBMapper instantiates a new mock Packet Broker Data Plane.

Jump to

Keyboard shortcuts

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