Documentation ¶
Index ¶
- Variables
- func RegisterMQTTServer(s *grpc.Server, srv MQTTServer)
- type MQTTClient
- type MQTTServer
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetPayload() string
- func (x *Message) GetRetained() bool
- func (x *Message) GetTopic() string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type SendMessageResult
- func (*SendMessageResult) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageResult) GetRetained() bool
- func (x *SendMessageResult) GetTopic() string
- func (*SendMessageResult) ProtoMessage()
- func (x *SendMessageResult) ProtoReflect() protoreflect.Message
- func (x *SendMessageResult) Reset()
- func (x *SendMessageResult) String() string
- type Server
- type UnimplementedMQTTServer
Constants ¶
This section is empty.
Variables ¶
View Source
var File_remote_mqtt_proto protoreflect.FileDescriptor
Functions ¶
func RegisterMQTTServer ¶
func RegisterMQTTServer(s *grpc.Server, srv MQTTServer)
Types ¶
type MQTTClient ¶
type MQTTClient interface { // Sends the specified message to the specified topic. // // returns true if the message has been sent. SendMessage(ctx context.Context, in *Message, opts ...grpc.CallOption) (*SendMessageResult, error) }
MQTTClient is the client API for MQTT service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMQTTClient ¶
func NewMQTTClient(cc grpc.ClientConnInterface) MQTTClient
type MQTTServer ¶
type MQTTServer interface { // Sends the specified message to the specified topic. // // returns true if the message has been sent. SendMessage(context.Context, *Message) (*SendMessageResult, error) }
MQTTServer is the server API for MQTT service.
type Message ¶
type Message struct { Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` Payload string `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` Retained bool `protobuf:"varint,3,opt,name=retained,proto3" json:"retained,omitempty"` // contains filtered or unexported fields }
Message represents a message being sent to MQTT
func (*Message) Descriptor
deprecated
func (*Message) GetPayload ¶
func (*Message) GetRetained ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶ added in v1.2.1
func (x *Message) ProtoReflect() protoreflect.Message
type SendMessageResult ¶
type SendMessageResult struct { Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` Retained bool `protobuf:"varint,2,opt,name=retained,proto3" json:"retained,omitempty"` // contains filtered or unexported fields }
MessageResult represents the result of a message being sent
func (*SendMessageResult) Descriptor
deprecated
func (*SendMessageResult) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageResult.ProtoReflect.Descriptor instead.
func (*SendMessageResult) GetRetained ¶
func (x *SendMessageResult) GetRetained() bool
func (*SendMessageResult) GetTopic ¶
func (x *SendMessageResult) GetTopic() string
func (*SendMessageResult) ProtoMessage ¶
func (*SendMessageResult) ProtoMessage()
func (*SendMessageResult) ProtoReflect ¶ added in v1.2.1
func (x *SendMessageResult) ProtoReflect() protoreflect.Message
func (*SendMessageResult) Reset ¶
func (x *SendMessageResult) Reset()
func (*SendMessageResult) String ¶
func (x *SendMessageResult) String() string
type Server ¶
type Server struct { Debug bool Port int Host string ConfigPath string Config *viper.Viper Logger log.FieldLogger MqttClient *mqttclient.MqttClient NewRelic newrelic.Application // contains filtered or unexported fields }
Server represents the server that replies to RPC messages
func NewServer ¶
func NewServer(host string, port int, configPath string, debug bool, logger log.FieldLogger) (*Server, error)
NewServer returns a new RPC Server
func (*Server) OnErrorHandler ¶
OnErrorHandler handles panics
func (*Server) SendMessage ¶
SendMessage to MQTT Server
type UnimplementedMQTTServer ¶ added in v1.2.1
type UnimplementedMQTTServer struct { }
UnimplementedMQTTServer can be embedded to have forward compatible implementations.
func (*UnimplementedMQTTServer) SendMessage ¶ added in v1.2.1
func (*UnimplementedMQTTServer) SendMessage(context.Context, *Message) (*SendMessageResult, error)
Click to show internal directories.
Click to hide internal directories.