Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterPingPongServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPingPongServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PingPongServiceClient) error
- func RegisterPingPongServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPingPongServiceServer(s *grpc.Server, srv PingPongServiceServer)
- type FetchPingCountRequest
- func (*FetchPingCountRequest) Descriptor() ([]byte, []int)
- func (m *FetchPingCountRequest) GetApi() string
- func (*FetchPingCountRequest) ProtoMessage()
- func (m *FetchPingCountRequest) Reset()
- func (m *FetchPingCountRequest) String() string
- func (m *FetchPingCountRequest) XXX_DiscardUnknown()
- func (m *FetchPingCountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FetchPingCountRequest) XXX_Merge(src proto.Message)
- func (m *FetchPingCountRequest) XXX_Size() int
- func (m *FetchPingCountRequest) XXX_Unmarshal(b []byte) error
- type FetchPingCountResponse
- func (*FetchPingCountResponse) Descriptor() ([]byte, []int)
- func (m *FetchPingCountResponse) GetApi() string
- func (m *FetchPingCountResponse) GetCount() int64
- func (*FetchPingCountResponse) ProtoMessage()
- func (m *FetchPingCountResponse) Reset()
- func (m *FetchPingCountResponse) String() string
- func (m *FetchPingCountResponse) XXX_DiscardUnknown()
- func (m *FetchPingCountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FetchPingCountResponse) XXX_Merge(src proto.Message)
- func (m *FetchPingCountResponse) XXX_Size() int
- func (m *FetchPingCountResponse) XXX_Unmarshal(b []byte) error
- type PingPongServiceClient
- type PingPongServiceServer
- type PingPongService_ServerStreamPingPongClient
- type PingPongService_ServerStreamPingPongServer
- type PingRequest
- func (*PingRequest) Descriptor() ([]byte, []int)
- func (m *PingRequest) GetPing() string
- func (*PingRequest) ProtoMessage()
- func (m *PingRequest) Reset()
- func (m *PingRequest) String() string
- func (m *PingRequest) XXX_DiscardUnknown()
- func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PingRequest) XXX_Merge(src proto.Message)
- func (m *PingRequest) XXX_Size() int
- func (m *PingRequest) XXX_Unmarshal(b []byte) error
- type PongResponse
- func (*PongResponse) Descriptor() ([]byte, []int)
- func (m *PongResponse) GetPong() string
- func (*PongResponse) ProtoMessage()
- func (m *PongResponse) Reset()
- func (m *PongResponse) String() string
- func (m *PongResponse) XXX_DiscardUnknown()
- func (m *PongResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PongResponse) XXX_Merge(src proto.Message)
- func (m *PongResponse) XXX_Size() int
- func (m *PongResponse) XXX_Unmarshal(b []byte) error
- type ServerStreamPingPongRequest
- func (*ServerStreamPingPongRequest) Descriptor() ([]byte, []int)
- func (m *ServerStreamPingPongRequest) GetPing() string
- func (m *ServerStreamPingPongRequest) GetPingCount() int32
- func (m *ServerStreamPingPongRequest) GetPingInterval() int32
- func (*ServerStreamPingPongRequest) ProtoMessage()
- func (m *ServerStreamPingPongRequest) Reset()
- func (m *ServerStreamPingPongRequest) String() string
- func (m *ServerStreamPingPongRequest) XXX_DiscardUnknown()
- func (m *ServerStreamPingPongRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ServerStreamPingPongRequest) XXX_Merge(src proto.Message)
- func (m *ServerStreamPingPongRequest) XXX_Size() int
- func (m *ServerStreamPingPongRequest) XXX_Unmarshal(b []byte) error
- type ServerStreamPingPongResponse
- func (*ServerStreamPingPongResponse) Descriptor() ([]byte, []int)
- func (m *ServerStreamPingPongResponse) GetPong() string
- func (*ServerStreamPingPongResponse) ProtoMessage()
- func (m *ServerStreamPingPongResponse) Reset()
- func (m *ServerStreamPingPongResponse) String() string
- func (m *ServerStreamPingPongResponse) XXX_DiscardUnknown()
- func (m *ServerStreamPingPongResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ServerStreamPingPongResponse) XXX_Merge(src proto.Message)
- func (m *ServerStreamPingPongResponse) XXX_Size() int
- func (m *ServerStreamPingPongResponse) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPingPongServiceHandler ¶
func RegisterPingPongServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterPingPongServiceHandler registers the http handlers for service PingPongService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPingPongServiceHandlerClient ¶
func RegisterPingPongServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PingPongServiceClient) error
RegisterPingPongServiceHandlerClient registers the http handlers for service PingPongService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PingPongServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PingPongServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PingPongServiceClient" to call the correct interceptors.
func RegisterPingPongServiceHandlerFromEndpoint ¶
func RegisterPingPongServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPingPongServiceHandlerFromEndpoint is same as RegisterPingPongServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPingPongServiceServer ¶
func RegisterPingPongServiceServer(s *grpc.Server, srv PingPongServiceServer)
Types ¶
type FetchPingCountRequest ¶
type FetchPingCountRequest struct { // API versioning: it is my best practice to specify version explicitly Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FetchPingCountRequest) Descriptor ¶
func (*FetchPingCountRequest) Descriptor() ([]byte, []int)
func (*FetchPingCountRequest) GetApi ¶
func (m *FetchPingCountRequest) GetApi() string
func (*FetchPingCountRequest) ProtoMessage ¶
func (*FetchPingCountRequest) ProtoMessage()
func (*FetchPingCountRequest) Reset ¶
func (m *FetchPingCountRequest) Reset()
func (*FetchPingCountRequest) String ¶
func (m *FetchPingCountRequest) String() string
func (*FetchPingCountRequest) XXX_DiscardUnknown ¶
func (m *FetchPingCountRequest) XXX_DiscardUnknown()
func (*FetchPingCountRequest) XXX_Marshal ¶
func (m *FetchPingCountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FetchPingCountRequest) XXX_Merge ¶
func (m *FetchPingCountRequest) XXX_Merge(src proto.Message)
func (*FetchPingCountRequest) XXX_Size ¶
func (m *FetchPingCountRequest) XXX_Size() int
func (*FetchPingCountRequest) XXX_Unmarshal ¶
func (m *FetchPingCountRequest) XXX_Unmarshal(b []byte) error
type FetchPingCountResponse ¶
type FetchPingCountResponse struct { Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` // Ping total count Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FetchPingCountResponse) Descriptor ¶
func (*FetchPingCountResponse) Descriptor() ([]byte, []int)
func (*FetchPingCountResponse) GetApi ¶
func (m *FetchPingCountResponse) GetApi() string
func (*FetchPingCountResponse) GetCount ¶
func (m *FetchPingCountResponse) GetCount() int64
func (*FetchPingCountResponse) ProtoMessage ¶
func (*FetchPingCountResponse) ProtoMessage()
func (*FetchPingCountResponse) Reset ¶
func (m *FetchPingCountResponse) Reset()
func (*FetchPingCountResponse) String ¶
func (m *FetchPingCountResponse) String() string
func (*FetchPingCountResponse) XXX_DiscardUnknown ¶
func (m *FetchPingCountResponse) XXX_DiscardUnknown()
func (*FetchPingCountResponse) XXX_Marshal ¶
func (m *FetchPingCountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FetchPingCountResponse) XXX_Merge ¶
func (m *FetchPingCountResponse) XXX_Merge(src proto.Message)
func (*FetchPingCountResponse) XXX_Size ¶
func (m *FetchPingCountResponse) XXX_Size() int
func (*FetchPingCountResponse) XXX_Unmarshal ¶
func (m *FetchPingCountResponse) XXX_Unmarshal(b []byte) error
type PingPongServiceClient ¶
type PingPongServiceClient interface { PingPong(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error) FetchPingCount(ctx context.Context, in *FetchPingCountRequest, opts ...grpc.CallOption) (*FetchPingCountResponse, error) ServerStreamPingPong(ctx context.Context, in *ServerStreamPingPongRequest, opts ...grpc.CallOption) (PingPongService_ServerStreamPingPongClient, error) }
PingPongServiceClient is the client API for PingPongService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewPingPongServiceClient ¶
func NewPingPongServiceClient(cc *grpc.ClientConn) PingPongServiceClient
type PingPongServiceServer ¶
type PingPongServiceServer interface { PingPong(context.Context, *PingRequest) (*PongResponse, error) FetchPingCount(context.Context, *FetchPingCountRequest) (*FetchPingCountResponse, error) ServerStreamPingPong(*ServerStreamPingPongRequest, PingPongService_ServerStreamPingPongServer) error }
PingPongServiceServer is the server API for PingPongService service.
type PingPongService_ServerStreamPingPongClient ¶
type PingPongService_ServerStreamPingPongClient interface { Recv() (*ServerStreamPingPongResponse, error) grpc.ClientStream }
type PingPongService_ServerStreamPingPongServer ¶
type PingPongService_ServerStreamPingPongServer interface { Send(*ServerStreamPingPongResponse) error grpc.ServerStream }
type PingRequest ¶
type PingRequest struct { Ping string `protobuf:"bytes,1,opt,name=ping,proto3" json:"ping,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PingRequest) Descriptor ¶
func (*PingRequest) Descriptor() ([]byte, []int)
func (*PingRequest) GetPing ¶
func (m *PingRequest) GetPing() string
func (*PingRequest) ProtoMessage ¶
func (*PingRequest) ProtoMessage()
func (*PingRequest) Reset ¶
func (m *PingRequest) Reset()
func (*PingRequest) String ¶
func (m *PingRequest) String() string
func (*PingRequest) XXX_DiscardUnknown ¶
func (m *PingRequest) XXX_DiscardUnknown()
func (*PingRequest) XXX_Marshal ¶
func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PingRequest) XXX_Merge ¶
func (m *PingRequest) XXX_Merge(src proto.Message)
func (*PingRequest) XXX_Size ¶
func (m *PingRequest) XXX_Size() int
func (*PingRequest) XXX_Unmarshal ¶
func (m *PingRequest) XXX_Unmarshal(b []byte) error
type PongResponse ¶
type PongResponse struct { Pong string `protobuf:"bytes,1,opt,name=pong,proto3" json:"pong,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PongResponse) Descriptor ¶
func (*PongResponse) Descriptor() ([]byte, []int)
func (*PongResponse) GetPong ¶
func (m *PongResponse) GetPong() string
func (*PongResponse) ProtoMessage ¶
func (*PongResponse) ProtoMessage()
func (*PongResponse) Reset ¶
func (m *PongResponse) Reset()
func (*PongResponse) String ¶
func (m *PongResponse) String() string
func (*PongResponse) XXX_DiscardUnknown ¶
func (m *PongResponse) XXX_DiscardUnknown()
func (*PongResponse) XXX_Marshal ¶
func (m *PongResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PongResponse) XXX_Merge ¶
func (m *PongResponse) XXX_Merge(src proto.Message)
func (*PongResponse) XXX_Size ¶
func (m *PongResponse) XXX_Size() int
func (*PongResponse) XXX_Unmarshal ¶
func (m *PongResponse) XXX_Unmarshal(b []byte) error
type ServerStreamPingPongRequest ¶
type ServerStreamPingPongRequest struct { Ping string `protobuf:"bytes,1,opt,name=ping,proto3" json:"ping,omitempty"` PingCount int32 `protobuf:"varint,2,opt,name=ping_count,json=pingCount,proto3" json:"ping_count,omitempty"` PingInterval int32 `protobuf:"varint,3,opt,name=ping_interval,json=pingInterval,proto3" json:"ping_interval,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ServerStreamPingPongRequest) Descriptor ¶
func (*ServerStreamPingPongRequest) Descriptor() ([]byte, []int)
func (*ServerStreamPingPongRequest) GetPing ¶
func (m *ServerStreamPingPongRequest) GetPing() string
func (*ServerStreamPingPongRequest) GetPingCount ¶
func (m *ServerStreamPingPongRequest) GetPingCount() int32
func (*ServerStreamPingPongRequest) GetPingInterval ¶
func (m *ServerStreamPingPongRequest) GetPingInterval() int32
func (*ServerStreamPingPongRequest) ProtoMessage ¶
func (*ServerStreamPingPongRequest) ProtoMessage()
func (*ServerStreamPingPongRequest) Reset ¶
func (m *ServerStreamPingPongRequest) Reset()
func (*ServerStreamPingPongRequest) String ¶
func (m *ServerStreamPingPongRequest) String() string
func (*ServerStreamPingPongRequest) XXX_DiscardUnknown ¶
func (m *ServerStreamPingPongRequest) XXX_DiscardUnknown()
func (*ServerStreamPingPongRequest) XXX_Marshal ¶
func (m *ServerStreamPingPongRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ServerStreamPingPongRequest) XXX_Merge ¶
func (m *ServerStreamPingPongRequest) XXX_Merge(src proto.Message)
func (*ServerStreamPingPongRequest) XXX_Size ¶
func (m *ServerStreamPingPongRequest) XXX_Size() int
func (*ServerStreamPingPongRequest) XXX_Unmarshal ¶
func (m *ServerStreamPingPongRequest) XXX_Unmarshal(b []byte) error
type ServerStreamPingPongResponse ¶
type ServerStreamPingPongResponse struct { Pong string `protobuf:"bytes,1,opt,name=pong,proto3" json:"pong,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ServerStreamPingPongResponse) Descriptor ¶
func (*ServerStreamPingPongResponse) Descriptor() ([]byte, []int)
func (*ServerStreamPingPongResponse) GetPong ¶
func (m *ServerStreamPingPongResponse) GetPong() string
func (*ServerStreamPingPongResponse) ProtoMessage ¶
func (*ServerStreamPingPongResponse) ProtoMessage()
func (*ServerStreamPingPongResponse) Reset ¶
func (m *ServerStreamPingPongResponse) Reset()
func (*ServerStreamPingPongResponse) String ¶
func (m *ServerStreamPingPongResponse) String() string
func (*ServerStreamPingPongResponse) XXX_DiscardUnknown ¶
func (m *ServerStreamPingPongResponse) XXX_DiscardUnknown()
func (*ServerStreamPingPongResponse) XXX_Marshal ¶
func (m *ServerStreamPingPongResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ServerStreamPingPongResponse) XXX_Merge ¶
func (m *ServerStreamPingPongResponse) XXX_Merge(src proto.Message)
func (*ServerStreamPingPongResponse) XXX_Size ¶
func (m *ServerStreamPingPongResponse) XXX_Size() int
func (*ServerStreamPingPongResponse) XXX_Unmarshal ¶
func (m *ServerStreamPingPongResponse) XXX_Unmarshal(b []byte) error