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: 15 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 {
	*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.

type NetworkServer

type NetworkServer struct {
	*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) (*pbtypes.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

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

ReportTxAcknowledgment implements ttnpb.GsNsServer.

func (*NetworkServer) Roles

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

Roles implements rpcserver.Registerer.

type PBControlPlane

type PBControlPlane struct {
	*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) (*pbtypes.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) (*pbtypes.Empty, error)
	ListEffectivePoliciesHandler   func(ctx context.Context, req *routingpb.ListEffectivePoliciesRequest) (*routingpb.ListEffectivePoliciesResponse, error)
}

PBControlPlane is a mock Packet Broker Control Plane.

func NewPBControlPlane

func NewPBControlPlane(tb testing.TB) *PBControlPlane

NewPBControlPlane instantiates a new mock Packet Broker Control Plane.

func (*PBControlPlane) GetDefaultPolicy

func (*PBControlPlane) GetHomeNetworkPolicy

func (*PBControlPlane) SetDefaultPolicy

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

func (*PBControlPlane) SetHomeNetworkPolicy

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

type PBDataPlane

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

PBDataPlane is a mock Packet Broker Data Plane.

func NewPBDataPlane

func NewPBDataPlane(cert tls.Certificate, clientCAs *x509.CertPool) *PBDataPlane

NewPBDataPlane instantiates a new mock Packet Broker Data Plane.

type PBIAM

type PBIAM struct {
	*grpc.Server
	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) (*pbtypes.Empty, error)
	DeleteNetworkHandler    func(ctx context.Context, req *iampb.NetworkRequest) (*pbtypes.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) (*pbtypes.Empty, error)
	DeleteTenantHandler     func(ctx context.Context, req *iampb.TenantRequest) (*pbtypes.Empty, error)
	ListHomeNetworksHandler func(ctx context.Context, req *iampbv2.ListHomeNetworksRequest) (*iampbv2.ListHomeNetworksResponse, error)
}

PBIAM is a mock Packet Broker IAM.

func NewPBIAM

func NewPBIAM(tb testing.TB) *PBIAM

NewPBIAM instantiates a new mock Packet Broker IAM.

func (*PBIAM) CreateNetwork

func (*PBIAM) CreateTenant

func (*PBIAM) DeleteNetwork

func (s *PBIAM) DeleteNetwork(ctx context.Context, req *iampb.NetworkRequest) (*pbtypes.Empty, error)

func (*PBIAM) DeleteTenant

func (s *PBIAM) DeleteTenant(ctx context.Context, req *iampb.TenantRequest) (*pbtypes.Empty, error)

func (*PBIAM) GetNetwork

func (s *PBIAM) GetNetwork(ctx context.Context, req *iampb.NetworkRequest) (*iampb.GetNetworkResponse, error)

func (*PBIAM) GetTenant

func (s *PBIAM) GetTenant(ctx context.Context, req *iampb.TenantRequest) (*iampb.GetTenantResponse, error)

func (*PBIAM) ListNetworks

func (*PBIAM) ListTenants

func (*PBIAM) UpdateNetwork

func (s *PBIAM) UpdateNetwork(ctx context.Context, req *iampb.UpdateNetworkRequest) (*pbtypes.Empty, error)

func (*PBIAM) UpdateTenant

func (s *PBIAM) UpdateTenant(ctx context.Context, req *iampb.UpdateTenantRequest) (*pbtypes.Empty, error)

Jump to

Keyboard shortcuts

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