router

package
v0.0.0-...-2f095fc Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2016 License: MIT Imports: 20 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")
)

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 is a wrapper around RouterClient

func NewClient

func NewClient(routerAnnouncement *discovery.Announcement) (*Client, error)

NewClient returns a new Client

func (*Client) Close

func (c *Client) Close() error

Close purges the cache and closes the connection with the Router

func (*Client) ForGateway

func (c *Client) ForGateway(gatewayID string, tokenFunc func() string) GatewayClient

ForGateway returns a GatewayClient that is configured for the provided gateway

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"`
}

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

func (m *DeviceActivationRequest) GetProtocolMetadata() *protocol.RxMetadata

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"`
}

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

func (m *DownlinkMessage) GetProtocolConfiguration() *protocol.TxConfiguration

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 GatewayClient

type GatewayClient interface {
	SendGatewayStatus(*gateway.Status) error
	SendUplink(*UplinkMessage) error
	Subscribe() (<-chan *DownlinkMessage, <-chan error, error)
	Unsubscribe() error
	Activate(*DeviceActivationRequest) (*DeviceActivationResponse, error)
	Close() error
}

GatewayClient is used as the main client for Gateways to communicate with the Router

func NewGatewayClient

func NewGatewayClient(client RouterClient, gatewayID string, tokenFunc func() string) GatewayClient

NewGatewayClient returns a new GatewayClient

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) 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) 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 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
	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
	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
	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
	Subscribe(*SubscribeRequest, Router_SubscribeServer) error
	// Gateway requests device activation
	Activate(context.Context, *DeviceActivationRequest) (*DeviceActivationResponse, error)
}

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 (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"`
}

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

func (m *UplinkMessage) GetProtocolMetadata() *protocol.RxMetadata

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

Jump to

Keyboard shortcuts

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