v1

package
v0.0.0-...-05a825e Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPublishServiceHandler

func RegisterPublishServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterPublishServiceHandler registers the http handlers for service PublishService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterPublishServiceHandlerClient

func RegisterPublishServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PublishServiceClient) error

RegisterPublishServiceHandlerClient registers the http handlers for service PublishService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PublishServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PublishServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PublishServiceClient" to call the correct interceptors.

func RegisterPublishServiceHandlerFromEndpoint

func RegisterPublishServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterPublishServiceHandlerFromEndpoint is same as RegisterPublishServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterPublishServiceHandlerServer

func RegisterPublishServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PublishServiceServer) error

RegisterPublishServiceHandlerServer registers the http handlers for service PublishService to "mux". UnaryRPC :call PublishServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterPublishServiceServer

func RegisterPublishServiceServer(s *grpc.Server, srv PublishServiceServer)

Types

type PublishRequest

type PublishRequest struct {
	Topic                string   `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	Data                 string   `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Message to publish to AWS IoT

func (*PublishRequest) Descriptor

func (*PublishRequest) Descriptor() ([]byte, []int)

func (*PublishRequest) GetData

func (m *PublishRequest) GetData() string

func (*PublishRequest) GetTopic

func (m *PublishRequest) GetTopic() string

func (*PublishRequest) ProtoMessage

func (*PublishRequest) ProtoMessage()

func (*PublishRequest) Reset

func (m *PublishRequest) Reset()

func (*PublishRequest) String

func (m *PublishRequest) String() string

func (*PublishRequest) Validate

func (this *PublishRequest) Validate() error

func (*PublishRequest) XXX_DiscardUnknown

func (m *PublishRequest) XXX_DiscardUnknown()

func (*PublishRequest) XXX_Marshal

func (m *PublishRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PublishRequest) XXX_Merge

func (m *PublishRequest) XXX_Merge(src proto.Message)

func (*PublishRequest) XXX_Size

func (m *PublishRequest) XXX_Size() int

func (*PublishRequest) XXX_Unmarshal

func (m *PublishRequest) XXX_Unmarshal(b []byte) error

type PublishResponse

type PublishResponse struct {
	Status               uint32   `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
	Message              string   `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Response body of the MQTT service after publishing

func (*PublishResponse) Descriptor

func (*PublishResponse) Descriptor() ([]byte, []int)

func (*PublishResponse) GetMessage

func (m *PublishResponse) GetMessage() string

func (*PublishResponse) GetStatus

func (m *PublishResponse) GetStatus() uint32

func (*PublishResponse) ProtoMessage

func (*PublishResponse) ProtoMessage()

func (*PublishResponse) Reset

func (m *PublishResponse) Reset()

func (*PublishResponse) String

func (m *PublishResponse) String() string

func (*PublishResponse) Validate

func (this *PublishResponse) Validate() error

func (*PublishResponse) XXX_DiscardUnknown

func (m *PublishResponse) XXX_DiscardUnknown()

func (*PublishResponse) XXX_Marshal

func (m *PublishResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PublishResponse) XXX_Merge

func (m *PublishResponse) XXX_Merge(src proto.Message)

func (*PublishResponse) XXX_Size

func (m *PublishResponse) XXX_Size() int

func (*PublishResponse) XXX_Unmarshal

func (m *PublishResponse) XXX_Unmarshal(b []byte) error

type PublishServiceClient

type PublishServiceClient interface {
	// Publish the message to AWS IoT
	Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error)
}

PublishServiceClient is the client API for PublishService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type PublishServiceServer

type PublishServiceServer interface {
	// Publish the message to AWS IoT
	Publish(context.Context, *PublishRequest) (*PublishResponse, error)
}

PublishServiceServer is the server API for PublishService service.

type UnimplementedPublishServiceServer

type UnimplementedPublishServiceServer struct {
}

UnimplementedPublishServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedPublishServiceServer) Publish

Jump to

Keyboard shortcuts

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