Documentation
¶
Overview ¶
Package router is a generated protocol buffer package.
It is generated from these files:
github.com/TheThingsNetwork/ttn/api/router/router.proto
It has these top-level messages:
SubscribeRequest UplinkMessage DownlinkMessage DeviceActivationRequest DeviceActivationResponse GatewayStatusRequest GatewayStatusResponse StatusRequest Status
Index ¶
- Variables
- func RegisterRouterManagerServer(s *grpc.Server, srv RouterManagerServer)
- func RegisterRouterServer(s *grpc.Server, srv RouterServer)
- type Client
- type ClientConfig
- type DeviceActivationRequest
- func (*DeviceActivationRequest) Descriptor() ([]byte, []int)
- func (m *DeviceActivationRequest) GetActivationMetadata() *protocol.ActivationMetadata
- func (m *DeviceActivationRequest) GetAppEui() *types.AppEUI
- func (m *DeviceActivationRequest) GetDevEui() *types.DevEUI
- func (m *DeviceActivationRequest) GetGatewayMetadata() *gateway.RxMetadata
- func (m *DeviceActivationRequest) GetMessage() *protocol.Message
- func (m *DeviceActivationRequest) GetPayload() []byte
- func (m *DeviceActivationRequest) GetProtocolMetadata() *protocol.RxMetadata
- func (m *DeviceActivationRequest) GetTrace() *trace.Trace
- func (m *DeviceActivationRequest) Marshal() (dAtA []byte, err error)
- func (m *DeviceActivationRequest) MarshalPayload() error
- func (m *DeviceActivationRequest) MarshalTo(dAtA []byte) (int, error)
- func (*DeviceActivationRequest) ProtoMessage()
- func (m *DeviceActivationRequest) Reset()
- func (m *DeviceActivationRequest) Size() (n int)
- func (m *DeviceActivationRequest) String() string
- func (m *DeviceActivationRequest) Unmarshal(dAtA []byte) error
- func (m *DeviceActivationRequest) UnmarshalPayload() error
- func (m *DeviceActivationRequest) Validate() error
- type DeviceActivationResponse
- func (*DeviceActivationResponse) Descriptor() ([]byte, []int)
- func (m *DeviceActivationResponse) Marshal() (dAtA []byte, err error)
- func (m *DeviceActivationResponse) MarshalTo(dAtA []byte) (int, error)
- func (*DeviceActivationResponse) ProtoMessage()
- func (m *DeviceActivationResponse) Reset()
- func (m *DeviceActivationResponse) Size() (n int)
- func (m *DeviceActivationResponse) String() string
- func (m *DeviceActivationResponse) Unmarshal(dAtA []byte) error
- type DownlinkMessage
- func RandomDownlinkMessage() *DownlinkMessage
- func RandomLorawanConfirmedDownlink(modulation ...lorawan.Modulation) *DownlinkMessage
- func RandomLorawanDownlinkMessage(modulation ...lorawan.Modulation) *DownlinkMessage
- func RandomLorawanJoinAccept(modulation ...lorawan.Modulation) *DownlinkMessage
- func RandomLorawanUnconfirmedDownlink(modulation ...lorawan.Modulation) *DownlinkMessage
- func (*DownlinkMessage) Descriptor() ([]byte, []int)
- func (m *DownlinkMessage) GetGatewayConfiguration() *gateway.TxConfiguration
- func (m *DownlinkMessage) GetMessage() *protocol.Message
- func (m *DownlinkMessage) GetPayload() []byte
- func (m *DownlinkMessage) GetProtocolConfiguration() *protocol.TxConfiguration
- func (m *DownlinkMessage) GetTrace() *trace.Trace
- func (m *DownlinkMessage) Marshal() (dAtA []byte, err error)
- func (m *DownlinkMessage) MarshalPayload() error
- func (m *DownlinkMessage) MarshalTo(dAtA []byte) (int, error)
- func (*DownlinkMessage) ProtoMessage()
- func (m *DownlinkMessage) Reset()
- func (m *DownlinkMessage) Size() (n int)
- func (m *DownlinkMessage) String() string
- func (m *DownlinkMessage) Unmarshal(dAtA []byte) error
- func (m *DownlinkMessage) UnmarshalPayload() error
- func (m *DownlinkMessage) Validate() error
- type GatewayStatusRequest
- func (*GatewayStatusRequest) Descriptor() ([]byte, []int)
- func (m *GatewayStatusRequest) GetGatewayId() string
- func (m *GatewayStatusRequest) Marshal() (dAtA []byte, err error)
- func (m *GatewayStatusRequest) MarshalTo(dAtA []byte) (int, error)
- func (*GatewayStatusRequest) ProtoMessage()
- func (m *GatewayStatusRequest) Reset()
- func (m *GatewayStatusRequest) Size() (n int)
- func (m *GatewayStatusRequest) String() string
- func (m *GatewayStatusRequest) Unmarshal(dAtA []byte) error
- type GatewayStatusResponse
- func (*GatewayStatusResponse) Descriptor() ([]byte, []int)
- func (m *GatewayStatusResponse) GetLastSeen() int64
- func (m *GatewayStatusResponse) GetStatus() *gateway.Status
- func (m *GatewayStatusResponse) Marshal() (dAtA []byte, err error)
- func (m *GatewayStatusResponse) MarshalTo(dAtA []byte) (int, error)
- func (*GatewayStatusResponse) ProtoMessage()
- func (m *GatewayStatusResponse) Reset()
- func (m *GatewayStatusResponse) Size() (n int)
- func (m *GatewayStatusResponse) String() string
- func (m *GatewayStatusResponse) Unmarshal(dAtA []byte) error
- type GenericStream
- type ReferenceRouterServer
- func (s *ReferenceRouterServer) Activate(ctx context.Context, req *DeviceActivationRequest) (*DeviceActivationResponse, error)
- func (s *ReferenceRouterServer) GatewayStatus(stream Router_GatewayStatusServer) (err error)
- func (s *ReferenceRouterServer) Subscribe(req *SubscribeRequest, stream Router_SubscribeServer) error
- func (s *ReferenceRouterServer) Uplink(stream Router_UplinkServer) error
- type RouterClient
- type RouterManagerClient
- type RouterManagerServer
- type RouterServer
- type RouterStreamServer
- func (s *RouterStreamServer) GatewayStatus(stream Router_GatewayStatusServer) error
- func (s *RouterStreamServer) SetLogger(logger log.Interface)
- func (s *RouterStreamServer) Subscribe(req *SubscribeRequest, stream Router_SubscribeServer) (err error)
- func (s *RouterStreamServer) Uplink(stream Router_UplinkServer) (err error)
- type Router_GatewayStatusClient
- type Router_GatewayStatusServer
- type Router_SubscribeClient
- type Router_SubscribeServer
- type Router_UplinkClient
- type Router_UplinkServer
- type Status
- func (*Status) Descriptor() ([]byte, []int)
- func (m *Status) GetActivations() *api.Rates
- func (m *Status) GetComponent() *api.ComponentStats
- func (m *Status) GetConnectedBrokers() uint32
- func (m *Status) GetConnectedGateways() uint32
- func (m *Status) GetDownlink() *api.Rates
- func (m *Status) GetGatewayStatus() *api.Rates
- func (m *Status) GetSystem() *api.SystemStats
- func (m *Status) GetUplink() *api.Rates
- func (m *Status) Marshal() (dAtA []byte, err error)
- func (m *Status) MarshalTo(dAtA []byte) (int, error)
- func (*Status) ProtoMessage()
- func (m *Status) Reset()
- func (m *Status) Size() (n int)
- func (m *Status) String() string
- func (m *Status) Unmarshal(dAtA []byte) error
- type StatusRequest
- func (*StatusRequest) Descriptor() ([]byte, []int)
- func (m *StatusRequest) Marshal() (dAtA []byte, err error)
- func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error)
- func (*StatusRequest) ProtoMessage()
- func (m *StatusRequest) Reset()
- func (m *StatusRequest) Size() (n int)
- func (m *StatusRequest) String() string
- func (m *StatusRequest) Unmarshal(dAtA []byte) error
- type SubscribeRequest
- func (*SubscribeRequest) Descriptor() ([]byte, []int)
- func (m *SubscribeRequest) Marshal() (dAtA []byte, err error)
- func (m *SubscribeRequest) MarshalTo(dAtA []byte) (int, error)
- func (*SubscribeRequest) ProtoMessage()
- func (m *SubscribeRequest) Reset()
- func (m *SubscribeRequest) Size() (n int)
- func (m *SubscribeRequest) String() string
- func (m *SubscribeRequest) Unmarshal(dAtA []byte) error
- type UplinkMessage
- func RandomLorawanConfirmedUplink(modulation ...lorawan.Modulation) *UplinkMessage
- func RandomLorawanJoinRequest(modulation ...lorawan.Modulation) *UplinkMessage
- func RandomLorawanUnconfirmedUplink(modulation ...lorawan.Modulation) *UplinkMessage
- func RandomLorawanUplinkMessage(modulation ...lorawan.Modulation) *UplinkMessage
- func RandomUplinkMessage() *UplinkMessage
- func (*UplinkMessage) Descriptor() ([]byte, []int)
- func (m *UplinkMessage) GetGatewayMetadata() *gateway.RxMetadata
- func (m *UplinkMessage) GetMessage() *protocol.Message
- func (m *UplinkMessage) GetPayload() []byte
- func (m *UplinkMessage) GetProtocolMetadata() *protocol.RxMetadata
- func (m *UplinkMessage) GetTrace() *trace.Trace
- func (m *UplinkMessage) Marshal() (dAtA []byte, err error)
- func (m *UplinkMessage) MarshalPayload() error
- func (m *UplinkMessage) MarshalTo(dAtA []byte) (int, error)
- func (*UplinkMessage) ProtoMessage()
- func (m *UplinkMessage) Reset()
- func (m *UplinkMessage) Size() (n int)
- func (m *UplinkMessage) String() string
- func (m *UplinkMessage) Unmarshal(dAtA []byte) error
- func (m *UplinkMessage) UnmarshalPayload() error
- func (m *UplinkMessage) Validate() error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthRouter = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRouter = fmt.Errorf("proto: integer overflow") )
var DefaultClientConfig = ClientConfig{ BackgroundContext: context.Background(), BufferSize: 10, }
DefaultClientConfig for router Client
var ErrDownlinkInactive = errors.New("Downlink stream not active")
ErrDownlinkInactive is returned by the Downlink func if downlink is inactive
Functions ¶
func RegisterRouterManagerServer ¶
func RegisterRouterManagerServer(s *grpc.Server, srv RouterManagerServer)
func RegisterRouterServer ¶
func RegisterRouterServer(s *grpc.Server, srv RouterServer)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for router
func NewClient ¶
func NewClient(config ClientConfig) *Client
NewClient creates a new Client with the given configuration
func (*Client) AddServer ¶
func (c *Client) AddServer(name string, conn *grpc.ClientConn)
AddServer adds a router server
func (*Client) NewGatewayStreams ¶
func (c *Client) NewGatewayStreams(id string, token string, downlinkActive bool) GenericStream
NewGatewayStreams returns new streams using the given gateway ID and token
type ClientConfig ¶
ClientConfig for router Client
type DeviceActivationRequest ¶
type DeviceActivationRequest struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
Message *protocol.Message `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
DevEui *github_com_TheThingsNetwork_ttn_core_types.DevEUI `` /* 141-byte string literal not displayed */
AppEui *github_com_TheThingsNetwork_ttn_core_types.AppEUI `` /* 141-byte string literal not displayed */
ProtocolMetadata *protocol.RxMetadata `protobuf:"bytes,21,opt,name=protocol_metadata,json=protocolMetadata" json:"protocol_metadata,omitempty"`
GatewayMetadata *gateway.RxMetadata `protobuf:"bytes,22,opt,name=gateway_metadata,json=gatewayMetadata" json:"gateway_metadata,omitempty"`
ActivationMetadata *protocol.ActivationMetadata `protobuf:"bytes,23,opt,name=activation_metadata,json=activationMetadata" json:"activation_metadata,omitempty"`
Trace *trace.Trace `protobuf:"bytes,31,opt,name=trace" json:"trace,omitempty"`
}
func (*DeviceActivationRequest) Descriptor ¶
func (*DeviceActivationRequest) Descriptor() ([]byte, []int)
func (*DeviceActivationRequest) GetActivationMetadata ¶
func (m *DeviceActivationRequest) GetActivationMetadata() *protocol.ActivationMetadata
func (*DeviceActivationRequest) GetAppEui ¶
func (m *DeviceActivationRequest) GetAppEui() *types.AppEUI
func (*DeviceActivationRequest) GetDevEui ¶
func (m *DeviceActivationRequest) GetDevEui() *types.DevEUI
func (*DeviceActivationRequest) GetGatewayMetadata ¶
func (m *DeviceActivationRequest) GetGatewayMetadata() *gateway.RxMetadata
func (*DeviceActivationRequest) GetMessage ¶
func (m *DeviceActivationRequest) GetMessage() *protocol.Message
func (*DeviceActivationRequest) GetPayload ¶
func (m *DeviceActivationRequest) GetPayload() []byte
func (*DeviceActivationRequest) GetProtocolMetadata ¶
func (m *DeviceActivationRequest) GetProtocolMetadata() *protocol.RxMetadata
func (*DeviceActivationRequest) GetTrace ¶
func (m *DeviceActivationRequest) GetTrace() *trace.Trace
func (*DeviceActivationRequest) Marshal ¶
func (m *DeviceActivationRequest) Marshal() (dAtA []byte, err error)
func (*DeviceActivationRequest) MarshalPayload ¶
func (m *DeviceActivationRequest) MarshalPayload() error
MarshalPayload marshals the Message into Payload if Payload is nil
func (*DeviceActivationRequest) MarshalTo ¶
func (m *DeviceActivationRequest) MarshalTo(dAtA []byte) (int, error)
func (*DeviceActivationRequest) ProtoMessage ¶
func (*DeviceActivationRequest) ProtoMessage()
func (*DeviceActivationRequest) Reset ¶
func (m *DeviceActivationRequest) Reset()
func (*DeviceActivationRequest) Size ¶
func (m *DeviceActivationRequest) Size() (n int)
func (*DeviceActivationRequest) String ¶
func (m *DeviceActivationRequest) String() string
func (*DeviceActivationRequest) Unmarshal ¶
func (m *DeviceActivationRequest) Unmarshal(dAtA []byte) error
func (*DeviceActivationRequest) UnmarshalPayload ¶
func (m *DeviceActivationRequest) UnmarshalPayload() error
UnmarshalPayload unmarshals the Payload into Message if Message is nil
func (*DeviceActivationRequest) Validate ¶
func (m *DeviceActivationRequest) Validate() error
Validate implements the api.Validator interface
type DeviceActivationResponse ¶
type DeviceActivationResponse struct {
}
func (*DeviceActivationResponse) Descriptor ¶
func (*DeviceActivationResponse) Descriptor() ([]byte, []int)
func (*DeviceActivationResponse) Marshal ¶
func (m *DeviceActivationResponse) Marshal() (dAtA []byte, err error)
func (*DeviceActivationResponse) MarshalTo ¶
func (m *DeviceActivationResponse) MarshalTo(dAtA []byte) (int, error)
func (*DeviceActivationResponse) ProtoMessage ¶
func (*DeviceActivationResponse) ProtoMessage()
func (*DeviceActivationResponse) Reset ¶
func (m *DeviceActivationResponse) Reset()
func (*DeviceActivationResponse) Size ¶
func (m *DeviceActivationResponse) Size() (n int)
func (*DeviceActivationResponse) String ¶
func (m *DeviceActivationResponse) String() string
func (*DeviceActivationResponse) Unmarshal ¶
func (m *DeviceActivationResponse) Unmarshal(dAtA []byte) error
type DownlinkMessage ¶
type DownlinkMessage struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
Message *protocol.Message `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
ProtocolConfiguration *protocol.TxConfiguration `protobuf:"bytes,11,opt,name=protocol_configuration,json=protocolConfiguration" json:"protocol_configuration,omitempty"`
GatewayConfiguration *gateway.TxConfiguration `protobuf:"bytes,12,opt,name=gateway_configuration,json=gatewayConfiguration" json:"gateway_configuration,omitempty"`
Trace *trace.Trace `protobuf:"bytes,21,opt,name=trace" json:"trace,omitempty"`
}
func RandomDownlinkMessage ¶
func RandomDownlinkMessage() *DownlinkMessage
RandomDownlinkMessage returns randomly generated downlink message. Used for testing.
func RandomLorawanConfirmedDownlink ¶
func RandomLorawanConfirmedDownlink(modulation ...lorawan.Modulation) *DownlinkMessage
RandomLorawanConfirmedDownlink returns randomly generated confirmed lorawan uplink message. Used for testing.
func RandomLorawanDownlinkMessage ¶
func RandomLorawanDownlinkMessage(modulation ...lorawan.Modulation) *DownlinkMessage
RandomLorawanDownlinkMessage returns randomly generated lorawan downlink message(join request, confirmed or unconfirmed downlink). Used for testing.
func RandomLorawanJoinAccept ¶
func RandomLorawanJoinAccept(modulation ...lorawan.Modulation) *DownlinkMessage
RandomLorawanJoinAccept returns randomly generated lorawan join request. Used for testing.
func RandomLorawanUnconfirmedDownlink ¶
func RandomLorawanUnconfirmedDownlink(modulation ...lorawan.Modulation) *DownlinkMessage
RandomLorawanUnconfirmedDownlink returns randomly generated unconfirmed lorawan uplink message. Used for testing.
func (*DownlinkMessage) Descriptor ¶
func (*DownlinkMessage) Descriptor() ([]byte, []int)
func (*DownlinkMessage) GetGatewayConfiguration ¶
func (m *DownlinkMessage) GetGatewayConfiguration() *gateway.TxConfiguration
func (*DownlinkMessage) GetMessage ¶
func (m *DownlinkMessage) GetMessage() *protocol.Message
func (*DownlinkMessage) GetPayload ¶
func (m *DownlinkMessage) GetPayload() []byte
func (*DownlinkMessage) GetProtocolConfiguration ¶
func (m *DownlinkMessage) GetProtocolConfiguration() *protocol.TxConfiguration
func (*DownlinkMessage) GetTrace ¶
func (m *DownlinkMessage) GetTrace() *trace.Trace
func (*DownlinkMessage) Marshal ¶
func (m *DownlinkMessage) Marshal() (dAtA []byte, err error)
func (*DownlinkMessage) MarshalPayload ¶
func (m *DownlinkMessage) MarshalPayload() error
MarshalPayload marshals the Message into Payload if Payload is nil
func (*DownlinkMessage) ProtoMessage ¶
func (*DownlinkMessage) ProtoMessage()
func (*DownlinkMessage) Reset ¶
func (m *DownlinkMessage) Reset()
func (*DownlinkMessage) Size ¶
func (m *DownlinkMessage) Size() (n int)
func (*DownlinkMessage) String ¶
func (m *DownlinkMessage) String() string
func (*DownlinkMessage) Unmarshal ¶
func (m *DownlinkMessage) Unmarshal(dAtA []byte) error
func (*DownlinkMessage) UnmarshalPayload ¶
func (m *DownlinkMessage) UnmarshalPayload() error
UnmarshalPayload unmarshals the Payload into Message if Message is nil
func (*DownlinkMessage) Validate ¶
func (m *DownlinkMessage) Validate() error
Validate implements the api.Validator interface
type GatewayStatusRequest ¶
type GatewayStatusRequest struct {
GatewayId string `protobuf:"bytes,1,opt,name=gateway_id,json=gatewayId,proto3" json:"gateway_id,omitempty"`
}
message GatewayStatusRequest is used to request the status of a gateway from this Router
func (*GatewayStatusRequest) Descriptor ¶
func (*GatewayStatusRequest) Descriptor() ([]byte, []int)
func (*GatewayStatusRequest) GetGatewayId ¶
func (m *GatewayStatusRequest) GetGatewayId() string
func (*GatewayStatusRequest) Marshal ¶
func (m *GatewayStatusRequest) Marshal() (dAtA []byte, err error)
func (*GatewayStatusRequest) MarshalTo ¶
func (m *GatewayStatusRequest) MarshalTo(dAtA []byte) (int, error)
func (*GatewayStatusRequest) ProtoMessage ¶
func (*GatewayStatusRequest) ProtoMessage()
func (*GatewayStatusRequest) Reset ¶
func (m *GatewayStatusRequest) Reset()
func (*GatewayStatusRequest) Size ¶
func (m *GatewayStatusRequest) Size() (n int)
func (*GatewayStatusRequest) String ¶
func (m *GatewayStatusRequest) String() string
func (*GatewayStatusRequest) Unmarshal ¶
func (m *GatewayStatusRequest) Unmarshal(dAtA []byte) error
type GatewayStatusResponse ¶
type GatewayStatusResponse struct {
LastSeen int64 `protobuf:"varint,1,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"`
Status *gateway.Status `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"`
}
func (*GatewayStatusResponse) Descriptor ¶
func (*GatewayStatusResponse) Descriptor() ([]byte, []int)
func (*GatewayStatusResponse) GetLastSeen ¶
func (m *GatewayStatusResponse) GetLastSeen() int64
func (*GatewayStatusResponse) GetStatus ¶
func (m *GatewayStatusResponse) GetStatus() *gateway.Status
func (*GatewayStatusResponse) Marshal ¶
func (m *GatewayStatusResponse) Marshal() (dAtA []byte, err error)
func (*GatewayStatusResponse) MarshalTo ¶
func (m *GatewayStatusResponse) MarshalTo(dAtA []byte) (int, error)
func (*GatewayStatusResponse) ProtoMessage ¶
func (*GatewayStatusResponse) ProtoMessage()
func (*GatewayStatusResponse) Reset ¶
func (m *GatewayStatusResponse) Reset()
func (*GatewayStatusResponse) Size ¶
func (m *GatewayStatusResponse) Size() (n int)
func (*GatewayStatusResponse) String ¶
func (m *GatewayStatusResponse) String() string
func (*GatewayStatusResponse) Unmarshal ¶
func (m *GatewayStatusResponse) Unmarshal(dAtA []byte) error
type GenericStream ¶
type GenericStream interface {
Uplink(*UplinkMessage)
Status(*gateway.Status)
Downlink() (<-chan *DownlinkMessage, error)
Close()
}
GenericStream is used for sending to and receiving from the router.
type ReferenceRouterServer ¶
type ReferenceRouterServer struct {
// contains filtered or unexported fields
}
ReferenceRouterServer is a new reference router server
func NewReferenceRouterServer ¶
func NewReferenceRouterServer(bufferSize int) *ReferenceRouterServer
NewReferenceRouterServer creates a new reference router server
func (*ReferenceRouterServer) Activate ¶
func (s *ReferenceRouterServer) Activate(ctx context.Context, req *DeviceActivationRequest) (*DeviceActivationResponse, error)
Activate RPC
func (*ReferenceRouterServer) GatewayStatus ¶
func (s *ReferenceRouterServer) GatewayStatus(stream Router_GatewayStatusServer) (err error)
GatewayStatus RPC
func (*ReferenceRouterServer) Subscribe ¶
func (s *ReferenceRouterServer) Subscribe(req *SubscribeRequest, stream Router_SubscribeServer) error
Subscribe RPC
func (*ReferenceRouterServer) Uplink ¶
func (s *ReferenceRouterServer) Uplink(stream Router_UplinkServer) error
Uplink RPC
type RouterClient ¶
type RouterClient interface {
// Gateway streams status messages to Router
GatewayStatus(ctx context.Context, opts ...grpc.CallOption) (Router_GatewayStatusClient, error)
// Gateway streams uplink messages to Router
Uplink(ctx context.Context, opts ...grpc.CallOption) (Router_UplinkClient, error)
// Gateway subscribes to downlink messages from Router
// It is possible to open multiple subscriptions (but not recommended).
// If you do this, you are responsible for de-duplication of downlink messages.
Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Router_SubscribeClient, error)
// Gateway requests device activation
Activate(ctx context.Context, in *DeviceActivationRequest, opts ...grpc.CallOption) (*DeviceActivationResponse, error)
}
func NewRouterClient ¶
func NewRouterClient(cc *grpc.ClientConn) RouterClient
type RouterManagerClient ¶
type RouterManagerClient interface {
// Gateway owner or network operator requests Gateway status from Router Manager
// Deprecated: Use monitor API (NOC) instead of this
GatewayStatus(ctx context.Context, in *GatewayStatusRequest, opts ...grpc.CallOption) (*GatewayStatusResponse, error)
// Network operator requests Router status
GetStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Status, error)
}
func NewRouterManagerClient ¶
func NewRouterManagerClient(cc *grpc.ClientConn) RouterManagerClient
type RouterManagerServer ¶
type RouterManagerServer interface {
// Gateway owner or network operator requests Gateway status from Router Manager
// Deprecated: Use monitor API (NOC) instead of this
GatewayStatus(context.Context, *GatewayStatusRequest) (*GatewayStatusResponse, error)
// Network operator requests Router status
GetStatus(context.Context, *StatusRequest) (*Status, error)
}
type RouterServer ¶
type RouterServer interface {
// Gateway streams status messages to Router
GatewayStatus(Router_GatewayStatusServer) error
// Gateway streams uplink messages to Router
Uplink(Router_UplinkServer) error
// Gateway subscribes to downlink messages from Router
// It is possible to open multiple subscriptions (but not recommended).
// If you do this, you are responsible for de-duplication of downlink messages.
Subscribe(*SubscribeRequest, Router_SubscribeServer) error
// Gateway requests device activation
Activate(context.Context, *DeviceActivationRequest) (*DeviceActivationResponse, error)
}
type RouterStreamServer ¶
type RouterStreamServer struct {
UplinkChanFunc func(md metadata.MD) (ch chan *UplinkMessage, err error)
GatewayStatusChanFunc func(md metadata.MD) (ch chan *gateway.Status, err error)
DownlinkChanFunc func(md metadata.MD) (ch <-chan *DownlinkMessage, cancel func(), err error)
// contains filtered or unexported fields
}
RouterStreamServer handles gRPC streams as channels
func NewRouterStreamServer ¶
func NewRouterStreamServer() *RouterStreamServer
NewRouterStreamServer returns a new RouterStreamServer
func (*RouterStreamServer) GatewayStatus ¶
func (s *RouterStreamServer) GatewayStatus(stream Router_GatewayStatusServer) error
GatewayStatus handles gateway status streams
func (*RouterStreamServer) SetLogger ¶
func (s *RouterStreamServer) SetLogger(logger log.Interface)
SetLogger sets the logger
func (*RouterStreamServer) Subscribe ¶
func (s *RouterStreamServer) Subscribe(req *SubscribeRequest, stream Router_SubscribeServer) (err error)
Subscribe handles downlink streams
func (*RouterStreamServer) Uplink ¶
func (s *RouterStreamServer) Uplink(stream Router_UplinkServer) (err error)
Uplink handles uplink streams
type Router_GatewayStatusClient ¶
type Router_GatewayStatusClient interface {
Send(*gateway.Status) error
CloseAndRecv() (*google_protobuf.Empty, error)
grpc.ClientStream
}
type Router_GatewayStatusServer ¶
type Router_GatewayStatusServer interface {
SendAndClose(*google_protobuf.Empty) error
Recv() (*gateway.Status, error)
grpc.ServerStream
}
type Router_SubscribeClient ¶
type Router_SubscribeClient interface {
Recv() (*DownlinkMessage, error)
grpc.ClientStream
}
type Router_SubscribeServer ¶
type Router_SubscribeServer interface {
Send(*DownlinkMessage) error
grpc.ServerStream
}
type Router_UplinkClient ¶
type Router_UplinkClient interface {
Send(*UplinkMessage) error
CloseAndRecv() (*google_protobuf.Empty, error)
grpc.ClientStream
}
type Router_UplinkServer ¶
type Router_UplinkServer interface {
SendAndClose(*google_protobuf.Empty) error
Recv() (*UplinkMessage, error)
grpc.ServerStream
}
type Status ¶
type Status struct {
System *api.SystemStats `protobuf:"bytes,1,opt,name=system" json:"system,omitempty"`
Component *api.ComponentStats `protobuf:"bytes,2,opt,name=component" json:"component,omitempty"`
GatewayStatus *api.Rates `protobuf:"bytes,11,opt,name=gateway_status,json=gatewayStatus" json:"gateway_status,omitempty"`
Uplink *api.Rates `protobuf:"bytes,12,opt,name=uplink" json:"uplink,omitempty"`
Downlink *api.Rates `protobuf:"bytes,13,opt,name=downlink" json:"downlink,omitempty"`
Activations *api.Rates `protobuf:"bytes,14,opt,name=activations" json:"activations,omitempty"`
// Connections
ConnectedGateways uint32 `protobuf:"varint,21,opt,name=connected_gateways,json=connectedGateways,proto3" json:"connected_gateways,omitempty"`
ConnectedBrokers uint32 `protobuf:"varint,22,opt,name=connected_brokers,json=connectedBrokers,proto3" json:"connected_brokers,omitempty"`
}
message Status is the response to the StatusRequest
func (*Status) Descriptor ¶
func (*Status) GetActivations ¶
func (*Status) GetComponent ¶
func (m *Status) GetComponent() *api.ComponentStats
func (*Status) GetConnectedBrokers ¶
func (*Status) GetConnectedGateways ¶
func (*Status) GetDownlink ¶
func (*Status) GetGatewayStatus ¶
func (*Status) GetSystem ¶
func (m *Status) GetSystem() *api.SystemStats
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
type StatusRequest ¶
type StatusRequest struct {
}
message StatusRequest is used to request the status of this Router
func (*StatusRequest) Descriptor ¶
func (*StatusRequest) Descriptor() ([]byte, []int)
func (*StatusRequest) Marshal ¶
func (m *StatusRequest) Marshal() (dAtA []byte, err error)
func (*StatusRequest) ProtoMessage ¶
func (*StatusRequest) ProtoMessage()
func (*StatusRequest) Reset ¶
func (m *StatusRequest) Reset()
func (*StatusRequest) Size ¶
func (m *StatusRequest) Size() (n int)
func (*StatusRequest) String ¶
func (m *StatusRequest) String() string
func (*StatusRequest) Unmarshal ¶
func (m *StatusRequest) Unmarshal(dAtA []byte) error
type SubscribeRequest ¶
type SubscribeRequest struct {
}
func (*SubscribeRequest) Descriptor ¶
func (*SubscribeRequest) Descriptor() ([]byte, []int)
func (*SubscribeRequest) Marshal ¶
func (m *SubscribeRequest) Marshal() (dAtA []byte, err error)
func (*SubscribeRequest) ProtoMessage ¶
func (*SubscribeRequest) ProtoMessage()
func (*SubscribeRequest) Reset ¶
func (m *SubscribeRequest) Reset()
func (*SubscribeRequest) Size ¶
func (m *SubscribeRequest) Size() (n int)
func (*SubscribeRequest) String ¶
func (m *SubscribeRequest) String() string
func (*SubscribeRequest) Unmarshal ¶
func (m *SubscribeRequest) Unmarshal(dAtA []byte) error
type UplinkMessage ¶
type UplinkMessage struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
Message *protocol.Message `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
ProtocolMetadata *protocol.RxMetadata `protobuf:"bytes,11,opt,name=protocol_metadata,json=protocolMetadata" json:"protocol_metadata,omitempty"`
GatewayMetadata *gateway.RxMetadata `protobuf:"bytes,12,opt,name=gateway_metadata,json=gatewayMetadata" json:"gateway_metadata,omitempty"`
Trace *trace.Trace `protobuf:"bytes,21,opt,name=trace" json:"trace,omitempty"`
}
func RandomLorawanConfirmedUplink ¶
func RandomLorawanConfirmedUplink(modulation ...lorawan.Modulation) *UplinkMessage
RandomLorawanConfirmedUplink returns randomly generated confirmed lorawan uplink message. Used for testing.
func RandomLorawanJoinRequest ¶
func RandomLorawanJoinRequest(modulation ...lorawan.Modulation) *UplinkMessage
RandomLorawanJoinRequest returns randomly generated lorawan join request. Used for testing.
func RandomLorawanUnconfirmedUplink ¶
func RandomLorawanUnconfirmedUplink(modulation ...lorawan.Modulation) *UplinkMessage
RandomLorawanUnconfirmedUplink returns randomly generated unconfirmed lorawan uplink message. Used for testing.
func RandomLorawanUplinkMessage ¶
func RandomLorawanUplinkMessage(modulation ...lorawan.Modulation) *UplinkMessage
RandomLorawanUplinkMessage returns randomly generated lorawan uplink message(join request, confirmed or unconfirmed uplink). Used for testing.
func RandomUplinkMessage ¶
func RandomUplinkMessage() *UplinkMessage
RandomUplinkMessage returns randomly generated uplink message. Used for testing.
func (*UplinkMessage) Descriptor ¶
func (*UplinkMessage) Descriptor() ([]byte, []int)
func (*UplinkMessage) GetGatewayMetadata ¶
func (m *UplinkMessage) GetGatewayMetadata() *gateway.RxMetadata
func (*UplinkMessage) GetMessage ¶
func (m *UplinkMessage) GetMessage() *protocol.Message
func (*UplinkMessage) GetPayload ¶
func (m *UplinkMessage) GetPayload() []byte
func (*UplinkMessage) GetProtocolMetadata ¶
func (m *UplinkMessage) GetProtocolMetadata() *protocol.RxMetadata
func (*UplinkMessage) GetTrace ¶
func (m *UplinkMessage) GetTrace() *trace.Trace
func (*UplinkMessage) Marshal ¶
func (m *UplinkMessage) Marshal() (dAtA []byte, err error)
func (*UplinkMessage) MarshalPayload ¶
func (m *UplinkMessage) MarshalPayload() error
MarshalPayload marshals the Message into Payload if Payload is nil
func (*UplinkMessage) ProtoMessage ¶
func (*UplinkMessage) ProtoMessage()
func (*UplinkMessage) Reset ¶
func (m *UplinkMessage) Reset()
func (*UplinkMessage) Size ¶
func (m *UplinkMessage) Size() (n int)
func (*UplinkMessage) String ¶
func (m *UplinkMessage) String() string
func (*UplinkMessage) Unmarshal ¶
func (m *UplinkMessage) Unmarshal(dAtA []byte) error
func (*UplinkMessage) UnmarshalPayload ¶
func (m *UplinkMessage) UnmarshalPayload() error
UnmarshalPayload unmarshals the Payload into Message if Message is nil
func (*UplinkMessage) Validate ¶
func (m *UplinkMessage) Validate() error
Validate implements the api.Validator interface