Documentation
¶
Overview ¶
Package monitor is a generated protocol buffer package.
It is generated from these files:
github.com/TheThingsNetwork/ttn/api/monitor/monitor.proto
It has these top-level messages:
Index ¶
- Constants
- func RegisterMonitorServer(s *grpc.Server, srv MonitorServer)
- type BrokerClient
- type Client
- type GatewayClient
- type MonitorClient
- type MonitorServer
- type Monitor_BrokerDownlinkClient
- type Monitor_BrokerDownlinkServer
- type Monitor_BrokerUplinkClient
- type Monitor_BrokerUplinkServer
- type Monitor_GatewayDownlinkClient
- type Monitor_GatewayDownlinkServer
- type Monitor_GatewayStatusClient
- type Monitor_GatewayStatusServer
- type Monitor_GatewayUplinkClient
- type Monitor_GatewayUplinkServer
- type Registry
Constants ¶
const BufferSize = 10
BufferSize gives the size for the monitor buffers
Variables ¶
This section is empty.
Functions ¶
func RegisterMonitorServer ¶
func RegisterMonitorServer(s *grpc.Server, srv MonitorServer)
Types ¶
type BrokerClient ¶
type BrokerClient interface {
SendUplink(msg *broker.DeduplicatedUplinkMessage) (err error)
SendDownlink(msg *broker.DownlinkMessage) (err error)
Close() (err error)
}
BrokerClient is used as the main client for Brokers to communicate with the monitor
type Client ¶
type Client struct {
Ctx ttnlog.Interface
BrokerClient BrokerClient
// contains filtered or unexported fields
}
Client is a wrapper around MonitorClient
func NewClient ¶
NewClient is a wrapper for NewMonitorClient, initializes connection to MonitorServer on monitorAddr with default gRPC options
func (*Client) GatewayClient ¶
func (cl *Client) GatewayClient(id string) (gtwCl GatewayClient)
GatewayClient returns monitor GatewayClient for id and token specified
func (*Client) IsConnected ¶
IsConnected returns whether connection to the monitor had been established or not
type GatewayClient ¶
type GatewayClient interface {
SetToken(token string)
IsConfigured() bool
SendStatus(status *gateway.Status) (err error)
SendUplink(msg *router.UplinkMessage) (err error)
SendDownlink(msg *router.DownlinkMessage) (err error)
Close() (err error)
}
GatewayClient is used as the main client for Gateways to communicate with the monitor
type MonitorClient ¶
type MonitorClient interface {
GatewayStatus(ctx context.Context, opts ...grpc.CallOption) (Monitor_GatewayStatusClient, error)
GatewayUplink(ctx context.Context, opts ...grpc.CallOption) (Monitor_GatewayUplinkClient, error)
GatewayDownlink(ctx context.Context, opts ...grpc.CallOption) (Monitor_GatewayDownlinkClient, error)
BrokerUplink(ctx context.Context, opts ...grpc.CallOption) (Monitor_BrokerUplinkClient, error)
BrokerDownlink(ctx context.Context, opts ...grpc.CallOption) (Monitor_BrokerDownlinkClient, error)
}
func NewMonitorClient ¶
func NewMonitorClient(cc *grpc.ClientConn) MonitorClient
type MonitorServer ¶
type MonitorServer interface {
GatewayStatus(Monitor_GatewayStatusServer) error
GatewayUplink(Monitor_GatewayUplinkServer) error
GatewayDownlink(Monitor_GatewayDownlinkServer) error
BrokerUplink(Monitor_BrokerUplinkServer) error
BrokerDownlink(Monitor_BrokerDownlinkServer) error
}
type Monitor_BrokerDownlinkClient ¶
type Monitor_BrokerDownlinkClient interface {
Send(*broker.DownlinkMessage) error
CloseAndRecv() (*google_protobuf1.Empty, error)
grpc.ClientStream
}
type Monitor_BrokerDownlinkServer ¶
type Monitor_BrokerDownlinkServer interface {
SendAndClose(*google_protobuf1.Empty) error
Recv() (*broker.DownlinkMessage, error)
grpc.ServerStream
}
type Monitor_BrokerUplinkClient ¶
type Monitor_BrokerUplinkClient interface {
Send(*broker.DeduplicatedUplinkMessage) error
CloseAndRecv() (*google_protobuf1.Empty, error)
grpc.ClientStream
}
type Monitor_BrokerUplinkServer ¶
type Monitor_BrokerUplinkServer interface {
SendAndClose(*google_protobuf1.Empty) error
Recv() (*broker.DeduplicatedUplinkMessage, error)
grpc.ServerStream
}
type Monitor_GatewayDownlinkClient ¶
type Monitor_GatewayDownlinkClient interface {
Send(*router.DownlinkMessage) error
CloseAndRecv() (*google_protobuf1.Empty, error)
grpc.ClientStream
}
type Monitor_GatewayDownlinkServer ¶
type Monitor_GatewayDownlinkServer interface {
SendAndClose(*google_protobuf1.Empty) error
Recv() (*router.DownlinkMessage, error)
grpc.ServerStream
}
type Monitor_GatewayStatusClient ¶
type Monitor_GatewayStatusClient interface {
Send(*gateway.Status) error
CloseAndRecv() (*google_protobuf1.Empty, error)
grpc.ClientStream
}
type Monitor_GatewayStatusServer ¶
type Monitor_GatewayStatusServer interface {
SendAndClose(*google_protobuf1.Empty) error
Recv() (*gateway.Status, error)
grpc.ServerStream
}
type Monitor_GatewayUplinkClient ¶
type Monitor_GatewayUplinkClient interface {
Send(*router.UplinkMessage) error
CloseAndRecv() (*google_protobuf1.Empty, error)
grpc.ClientStream
}
type Monitor_GatewayUplinkServer ¶
type Monitor_GatewayUplinkServer interface {
SendAndClose(*google_protobuf1.Empty) error
Recv() (*router.UplinkMessage, error)
grpc.ServerStream
}
type Registry ¶
type Registry interface {
// InitClient initializes a new monitor client.
InitClient(name string, addr string)
// BrokerClients returns the list of broker monitor clients that have currently been initialized.
BrokerClients() []BrokerClient
// GatewayClients returns the list of gateway monitor clients that have currently been initialized for a given gateway.
GatewayClients(id string) []GatewayClient
// SetGatewayToken configures a token that's applied to all clients for a gateway, regardless of when it's initialized.
SetGatewayToken(id string, token string)
}
Registry encapsulates dealing with monitor servers that might be down during startup.
func NewRegistry ¶
NewRegistry creates a monitor client registry.