Documentation ¶
Overview ¶
Package blogapi is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterBlogServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterBlogServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BlogServiceClient) error
- func RegisterBlogServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterBlogServiceServer(s *grpc.Server, srv BlogServiceServer)
- type BlogServiceClient
- type BlogServiceServer
- type Pong
- func (*Pong) Descriptor() ([]byte, []int)
- func (m *Pong) GetAnswer() string
- func (*Pong) ProtoMessage()
- func (m *Pong) Reset()
- func (m *Pong) String() string
- func (m *Pong) XXX_DiscardUnknown()
- func (m *Pong) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Pong) XXX_Merge(src proto.Message)
- func (m *Pong) XXX_Size() int
- func (m *Pong) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterBlogServiceHandler ¶
func RegisterBlogServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterBlogServiceHandler registers the http handlers for service BlogService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterBlogServiceHandlerClient ¶
func RegisterBlogServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BlogServiceClient) error
RegisterBlogServiceHandlerClient registers the http handlers for service BlogService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BlogServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BlogServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "BlogServiceClient" to call the correct interceptors.
func RegisterBlogServiceHandlerFromEndpoint ¶
func RegisterBlogServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterBlogServiceHandlerFromEndpoint is same as RegisterBlogServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterBlogServiceServer ¶
func RegisterBlogServiceServer(s *grpc.Server, srv BlogServiceServer)
Types ¶
type BlogServiceClient ¶
type BlogServiceClient interface {
Ping(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Pong, error)
}
BlogServiceClient is the client API for BlogService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewBlogServiceClient ¶
func NewBlogServiceClient(cc *grpc.ClientConn) BlogServiceClient
type BlogServiceServer ¶
BlogServiceServer is the server API for BlogService service.
type Pong ¶
type Pong struct { Answer string `protobuf:"bytes,1,opt,name=answer,proto3" json:"answer,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Pong) Descriptor ¶
func (*Pong) ProtoMessage ¶
func (*Pong) ProtoMessage()
func (*Pong) XXX_DiscardUnknown ¶
func (m *Pong) XXX_DiscardUnknown()