pb

package
v0.0.0-...-12d8bdd Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package blogapi is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

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

type BlogServiceServer interface {
	Ping(context.Context, *empty.Empty) (*Pong, error)
}

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) Descriptor() ([]byte, []int)

func (*Pong) GetAnswer

func (m *Pong) GetAnswer() string

func (*Pong) ProtoMessage

func (*Pong) ProtoMessage()

func (*Pong) Reset

func (m *Pong) Reset()

func (*Pong) String

func (m *Pong) String() string

func (*Pong) XXX_DiscardUnknown

func (m *Pong) XXX_DiscardUnknown()

func (*Pong) XXX_Marshal

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

func (*Pong) XXX_Merge

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

func (*Pong) XXX_Size

func (m *Pong) XXX_Size() int

func (*Pong) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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