router

package
v2.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2017 License: MIT Imports: 23 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthRouter = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRouter   = fmt.Errorf("proto: integer overflow")
)
View Source
var DefaultBufferSize = 10

DefaultBufferSize indicates the default send and receive buffer sizes

Functions

func RegisterRouterManagerServer

func RegisterRouterManagerServer(s *grpc.Server, srv RouterManagerServer)

func RegisterRouterServer

func RegisterRouterServer(s *grpc.Server, srv RouterServer)

Types

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) 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 (*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) MarshalTo

func (m *DownlinkMessage) MarshalTo(dAtA []byte) (int, error)

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 DownlinkStream

type DownlinkStream interface {
	GatewayStream
	Channel() <-chan *DownlinkMessage
}

DownlinkStream for receiving downlink messages

func NewMonitoredDownlinkStream

func NewMonitoredDownlinkStream(client RouterClientForGateway) DownlinkStream

NewMonitoredDownlinkStream starts and monitors a DownlinkStream

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 GatewayStatusStream

type GatewayStatusStream interface {
	GatewayStream
	Send(*gateway.Status) error
}

GatewayStatusStream for sending gateway statuses

func NewMonitoredGatewayStatusStream

func NewMonitoredGatewayStatusStream(client RouterClientForGateway) GatewayStatusStream

NewMonitoredGatewayStatusStream starts and monitors a GatewayStatusStream

type GatewayStream

type GatewayStream interface {
	Close()
}

GatewayStream interface

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 RouterClientForGateway

type RouterClientForGateway interface {
	Close()

	GetLogger() log.Interface
	SetLogger(log.Interface)

	SetToken(token string)
	TokenChange() <-chan struct{}

	GatewayStatus() (Router_GatewayStatusClient, error)
	Uplink() (Router_UplinkClient, error)
	Subscribe() (Router_SubscribeClient, context.CancelFunc, error)
	Activate(in *DeviceActivationRequest) (*DeviceActivationResponse, error)
}

RouterClientForGateway is a RouterClient for a specific gateway

func NewRouterClientForGateway

func NewRouterClientForGateway(client RouterClient, gatewayID, token string) RouterClientForGateway

NewRouterClientForGateway returns a new RouterClient for the given gateway ID and access token

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 (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) Descriptor() ([]byte, []int)

func (*Status) GetActivations

func (m *Status) GetActivations() *api.Rates

func (*Status) GetComponent

func (m *Status) GetComponent() *api.ComponentStats

func (*Status) GetConnectedBrokers

func (m *Status) GetConnectedBrokers() uint32

func (*Status) GetConnectedGateways

func (m *Status) GetConnectedGateways() uint32
func (m *Status) GetDownlink() *api.Rates

func (*Status) GetGatewayStatus

func (m *Status) GetGatewayStatus() *api.Rates

func (*Status) GetSystem

func (m *Status) GetSystem() *api.SystemStats
func (m *Status) GetUplink() *api.Rates

func (*Status) Marshal

func (m *Status) Marshal() (dAtA []byte, err error)

func (*Status) MarshalTo

func (m *Status) MarshalTo(dAtA []byte) (int, error)

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) Reset

func (m *Status) Reset()

func (*Status) Size

func (m *Status) Size() (n int)

func (*Status) String

func (m *Status) String() string

func (*Status) Unmarshal

func (m *Status) Unmarshal(dAtA []byte) error

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) MarshalTo

func (m *StatusRequest) MarshalTo(dAtA []byte) (int, 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) MarshalTo

func (m *SubscribeRequest) MarshalTo(dAtA []byte) (int, 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 (*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) MarshalTo

func (m *UplinkMessage) MarshalTo(dAtA []byte) (int, error)

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

type UplinkStream

type UplinkStream interface {
	GatewayStream
	Send(*UplinkMessage) error
}

UplinkStream for sending uplink messages

func NewMonitoredUplinkStream

func NewMonitoredUplinkStream(client RouterClientForGateway) UplinkStream

NewMonitoredUplinkStream starts and monitors a UplinkStream

Jump to

Keyboard shortcuts

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