Documentation ¶
Overview ¶
Package pb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterAgentHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAgentHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentClient) error
- func RegisterAgentHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAgentHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentServer) error
- func RegisterAgentServer(s *grpc.Server, srv AgentServer)
- type AgentClient
- type AgentServer
- type HostnameReply
- func (*HostnameReply) Descriptor() ([]byte, []int)
- func (m *HostnameReply) GetHostname() string
- func (*HostnameReply) ProtoMessage()
- func (m *HostnameReply) Reset()
- func (m *HostnameReply) String() string
- func (m *HostnameReply) XXX_DiscardUnknown()
- func (m *HostnameReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HostnameReply) XXX_Merge(src proto.Message)
- func (m *HostnameReply) XXX_Size() int
- func (m *HostnameReply) XXX_Unmarshal(b []byte) error
- type HostnameRequest
- func (*HostnameRequest) Descriptor() ([]byte, []int)
- func (*HostnameRequest) ProtoMessage()
- func (m *HostnameRequest) Reset()
- func (m *HostnameRequest) String() string
- func (m *HostnameRequest) XXX_DiscardUnknown()
- func (m *HostnameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HostnameRequest) XXX_Merge(src proto.Message)
- func (m *HostnameRequest) XXX_Size() int
- func (m *HostnameRequest) XXX_Unmarshal(b []byte) error
- type UnimplementedAgentServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAgentHandler ¶
RegisterAgentHandler registers the http handlers for service Agent to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAgentHandlerClient ¶
func RegisterAgentHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentClient) error
RegisterAgentHandlerClient registers the http handlers for service Agent to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AgentClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AgentClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AgentClient" to call the correct interceptors.
func RegisterAgentHandlerFromEndpoint ¶
func RegisterAgentHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAgentHandlerFromEndpoint is same as RegisterAgentHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAgentHandlerServer ¶
func RegisterAgentHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentServer) error
RegisterAgentHandlerServer registers the http handlers for service Agent to "mux". UnaryRPC :call AgentServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterAgentServer ¶
func RegisterAgentServer(s *grpc.Server, srv AgentServer)
Types ¶
type AgentClient ¶
type AgentClient interface { // get the hostname GetHostname(ctx context.Context, in *HostnameRequest, opts ...grpc.CallOption) (*HostnameReply, error) }
AgentClient is the client API for Agent service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewAgentClient ¶
func NewAgentClient(cc *grpc.ClientConn) AgentClient
type AgentServer ¶
type AgentServer interface { // get the hostname GetHostname(context.Context, *HostnameRequest) (*HostnameReply, error) }
AgentServer is the server API for Agent service.
type HostnameReply ¶
type HostnameReply struct { Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
The response message containing the greetings
func (*HostnameReply) Descriptor ¶
func (*HostnameReply) Descriptor() ([]byte, []int)
func (*HostnameReply) GetHostname ¶
func (m *HostnameReply) GetHostname() string
func (*HostnameReply) ProtoMessage ¶
func (*HostnameReply) ProtoMessage()
func (*HostnameReply) Reset ¶
func (m *HostnameReply) Reset()
func (*HostnameReply) String ¶
func (m *HostnameReply) String() string
func (*HostnameReply) XXX_DiscardUnknown ¶
func (m *HostnameReply) XXX_DiscardUnknown()
func (*HostnameReply) XXX_Marshal ¶
func (m *HostnameReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HostnameReply) XXX_Merge ¶
func (m *HostnameReply) XXX_Merge(src proto.Message)
func (*HostnameReply) XXX_Size ¶
func (m *HostnameReply) XXX_Size() int
func (*HostnameReply) XXX_Unmarshal ¶
func (m *HostnameReply) XXX_Unmarshal(b []byte) error
type HostnameRequest ¶
type HostnameRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HostnameRequest) Descriptor ¶
func (*HostnameRequest) Descriptor() ([]byte, []int)
func (*HostnameRequest) ProtoMessage ¶
func (*HostnameRequest) ProtoMessage()
func (*HostnameRequest) Reset ¶
func (m *HostnameRequest) Reset()
func (*HostnameRequest) String ¶
func (m *HostnameRequest) String() string
func (*HostnameRequest) XXX_DiscardUnknown ¶
func (m *HostnameRequest) XXX_DiscardUnknown()
func (*HostnameRequest) XXX_Marshal ¶
func (m *HostnameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HostnameRequest) XXX_Merge ¶
func (m *HostnameRequest) XXX_Merge(src proto.Message)
func (*HostnameRequest) XXX_Size ¶
func (m *HostnameRequest) XXX_Size() int
func (*HostnameRequest) XXX_Unmarshal ¶
func (m *HostnameRequest) XXX_Unmarshal(b []byte) error
type UnimplementedAgentServer ¶
type UnimplementedAgentServer struct { }
UnimplementedAgentServer can be embedded to have forward compatible implementations.
func (*UnimplementedAgentServer) GetHostname ¶
func (*UnimplementedAgentServer) GetHostname(ctx context.Context, req *HostnameRequest) (*HostnameReply, error)