Documentation ¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterExampleServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterExampleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExampleServiceClient) error
- func RegisterExampleServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterExampleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ExampleServiceServer) error
- func RegisterExampleServiceServer(s *grpc.Server, srv ExampleServiceServer)
- func ServiceDescExampleService() grpc.ServiceDesc
- type ApiRequest
- func (*ApiRequest) Descriptor() ([]byte, []int)
- func (m *ApiRequest) GetName() string
- func (m *ApiRequest) GetServices() string
- func (*ApiRequest) ProtoMessage()
- func (m *ApiRequest) Reset()
- func (m *ApiRequest) String() string
- func (m *ApiRequest) Validate() error
- func (m *ApiRequest) XXX_DiscardUnknown()
- func (m *ApiRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ApiRequest) XXX_Merge(src proto.Message)
- func (m *ApiRequest) XXX_Size() int
- func (m *ApiRequest) XXX_Unmarshal(b []byte) error
- type ApiRequestValidationError
- type ExampleServiceClient
- type ExampleServiceServer
- type Node
- func (*Node) Descriptor() ([]byte, []int)
- func (m *Node) GetHost() string
- func (m *Node) GetId() string
- func (*Node) ProtoMessage()
- func (m *Node) Reset()
- func (m *Node) String() string
- func (m *Node) Validate() error
- func (m *Node) XXX_DiscardUnknown()
- func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Node) XXX_Merge(src proto.Message)
- func (m *Node) XXX_Size() int
- func (m *Node) XXX_Unmarshal(b []byte) error
- type NodeValidationError
- type Request
- func (*Request) Descriptor() ([]byte, []int)
- func (m *Request) GetName() string
- func (m *Request) GetServices() []*Service
- func (m *Request) GetVersion() string
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) String() string
- func (m *Request) Validate() error
- func (m *Request) XXX_DiscardUnknown()
- func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Request) XXX_Merge(src proto.Message)
- func (m *Request) XXX_Size() int
- func (m *Request) XXX_Unmarshal(b []byte) error
- type RequestValidationError
- type Response
- func (*Response) Descriptor() ([]byte, []int)
- func (m *Response) GetChain() []*Response_Chain
- func (m *Response) GetMsg() string
- func (*Response) ProtoMessage()
- func (m *Response) Reset()
- func (m *Response) String() string
- func (m *Response) Validate() error
- func (m *Response) XXX_DiscardUnknown()
- func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Response) XXX_Merge(src proto.Message)
- func (m *Response) XXX_Size() int
- func (m *Response) XXX_Unmarshal(b []byte) error
- type ResponseValidationError
- type Response_Chain
- func (*Response_Chain) Descriptor() ([]byte, []int)
- func (m *Response_Chain) GetChain() []*Response_Chain
- func (m *Response_Chain) GetCtx() string
- func (m *Response_Chain) GetService() *Service
- func (*Response_Chain) ProtoMessage()
- func (m *Response_Chain) Reset()
- func (m *Response_Chain) String() string
- func (m *Response_Chain) Validate() error
- func (m *Response_Chain) XXX_DiscardUnknown()
- func (m *Response_Chain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Response_Chain) XXX_Merge(src proto.Message)
- func (m *Response_Chain) XXX_Size() int
- func (m *Response_Chain) XXX_Unmarshal(b []byte) error
- type Response_ChainValidationError
- func (e Response_ChainValidationError) Cause() error
- func (e Response_ChainValidationError) Error() string
- func (e Response_ChainValidationError) ErrorName() string
- func (e Response_ChainValidationError) Field() string
- func (e Response_ChainValidationError) Key() bool
- func (e Response_ChainValidationError) Reason() string
- type Service
- func (*Service) Descriptor() ([]byte, []int)
- func (m *Service) GetName() string
- func (m *Service) GetNode() *Node
- func (m *Service) GetServices() []*Service
- func (m *Service) GetVersion() string
- func (*Service) ProtoMessage()
- func (m *Service) Reset()
- func (m *Service) String() string
- func (m *Service) Validate() error
- func (m *Service) XXX_DiscardUnknown()
- func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Service) XXX_Merge(src proto.Message)
- func (m *Service) XXX_Size() int
- func (m *Service) XXX_Unmarshal(b []byte) error
- type ServiceValidationError
- type UnimplementedExampleServiceServer
Constants ¶
This section is empty.
Variables ¶
var GatewayServiceExampleService = registry.Service{ Name: _ExampleService_serviceDesc.ServiceName, Methods: []*registry.Method{ ®istry.Method{ Name: "ApiCall", Bindings: []*registry.Binding{ &route_ExampleService_ApiCall_0, &route_ExampleService_ApiCall_1, }, }, ®istry.Method{ Name: "Call", Bindings: []*registry.Binding{ &route_ExampleService_Call_0, &route_ExampleService_Call_1, }, }, }, }
var RegistryServiceExampleService = registry.Service{ Name: _ExampleService_serviceDesc.ServiceName, Methods: []*registry.Method{ ®istry.Method{ Name: "ApiCall", }, ®istry.Method{ Name: "Call", }, }, }
ExampleService registry service
Functions ¶
func RegisterExampleServiceHandler ¶
func RegisterExampleServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterExampleServiceHandler registers the http handlers for service ExampleService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterExampleServiceHandlerClient ¶
func RegisterExampleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExampleServiceClient) error
RegisterExampleServiceHandlerClient registers the http handlers for service ExampleService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ExampleServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ExampleServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ExampleServiceClient" to call the correct interceptors.
func RegisterExampleServiceHandlerFromEndpoint ¶
func RegisterExampleServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterExampleServiceHandlerFromEndpoint is same as RegisterExampleServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterExampleServiceHandlerServer ¶
func RegisterExampleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ExampleServiceServer) error
RegisterExampleServiceHandlerServer registers the http handlers for service ExampleService to "mux". UnaryRPC :call ExampleServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterExampleServiceServer ¶
func RegisterExampleServiceServer(s *grpc.Server, srv ExampleServiceServer)
func ServiceDescExampleService ¶
func ServiceDescExampleService() grpc.ServiceDesc
ExampleService desc
Types ¶
type ApiRequest ¶
type ApiRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Services string `protobuf:"bytes,2,opt,name=services,proto3" json:"services,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ApiRequest) Descriptor ¶
func (*ApiRequest) Descriptor() ([]byte, []int)
func (*ApiRequest) GetName ¶
func (m *ApiRequest) GetName() string
func (*ApiRequest) GetServices ¶
func (m *ApiRequest) GetServices() string
func (*ApiRequest) ProtoMessage ¶
func (*ApiRequest) ProtoMessage()
func (*ApiRequest) Reset ¶
func (m *ApiRequest) Reset()
func (*ApiRequest) String ¶
func (m *ApiRequest) String() string
func (*ApiRequest) Validate ¶
func (m *ApiRequest) Validate() error
Validate checks the field values on ApiRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*ApiRequest) XXX_DiscardUnknown ¶
func (m *ApiRequest) XXX_DiscardUnknown()
func (*ApiRequest) XXX_Marshal ¶
func (m *ApiRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ApiRequest) XXX_Merge ¶
func (m *ApiRequest) XXX_Merge(src proto.Message)
func (*ApiRequest) XXX_Size ¶
func (m *ApiRequest) XXX_Size() int
func (*ApiRequest) XXX_Unmarshal ¶
func (m *ApiRequest) XXX_Unmarshal(b []byte) error
type ApiRequestValidationError ¶
type ApiRequestValidationError struct {
// contains filtered or unexported fields
}
ApiRequestValidationError is the validation error returned by ApiRequest.Validate if the designated constraints aren't met.
func (ApiRequestValidationError) Cause ¶
func (e ApiRequestValidationError) Cause() error
Cause function returns cause value.
func (ApiRequestValidationError) Error ¶
func (e ApiRequestValidationError) Error() string
Error satisfies the builtin error interface
func (ApiRequestValidationError) ErrorName ¶
func (e ApiRequestValidationError) ErrorName() string
ErrorName returns error name.
func (ApiRequestValidationError) Field ¶
func (e ApiRequestValidationError) Field() string
Field function returns field value.
func (ApiRequestValidationError) Key ¶
func (e ApiRequestValidationError) Key() bool
Key function returns key value.
func (ApiRequestValidationError) Reason ¶
func (e ApiRequestValidationError) Reason() string
Reason function returns reason value.
type ExampleServiceClient ¶
type ExampleServiceClient interface { ApiCall(ctx context.Context, in *ApiRequest, opts ...grpc.CallOption) (*Response, error) Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) }
ExampleServiceClient is the client API for ExampleService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewExampleServiceClient ¶
func NewExampleServiceClient(cc *grpc.ClientConn) ExampleServiceClient
type ExampleServiceServer ¶
type ExampleServiceServer interface { ApiCall(context.Context, *ApiRequest) (*Response, error) Call(context.Context, *Request) (*Response, error) }
ExampleServiceServer is the server API for ExampleService service.
type Node ¶
type Node struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Node) Descriptor ¶
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) Validate ¶
Validate checks the field values on Node with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Node) XXX_DiscardUnknown ¶
func (m *Node) XXX_DiscardUnknown()
func (*Node) XXX_Unmarshal ¶
type NodeValidationError ¶
type NodeValidationError struct {
// contains filtered or unexported fields
}
NodeValidationError is the validation error returned by Node.Validate if the designated constraints aren't met.
func (NodeValidationError) Cause ¶
func (e NodeValidationError) Cause() error
Cause function returns cause value.
func (NodeValidationError) Error ¶
func (e NodeValidationError) Error() string
Error satisfies the builtin error interface
func (NodeValidationError) ErrorName ¶
func (e NodeValidationError) ErrorName() string
ErrorName returns error name.
func (NodeValidationError) Field ¶
func (e NodeValidationError) Field() string
Field function returns field value.
func (NodeValidationError) Key ¶
func (e NodeValidationError) Key() bool
Key function returns key value.
func (NodeValidationError) Reason ¶
func (e NodeValidationError) Reason() string
Reason function returns reason value.
type Request ¶
type Request struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` Services []*Service `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Request) Descriptor ¶
func (*Request) GetServices ¶
func (*Request) GetVersion ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) Validate ¶
Validate checks the field values on Request with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Request) XXX_DiscardUnknown ¶
func (m *Request) XXX_DiscardUnknown()
func (*Request) XXX_Marshal ¶
func (*Request) XXX_Unmarshal ¶
type RequestValidationError ¶
type RequestValidationError struct {
// contains filtered or unexported fields
}
RequestValidationError is the validation error returned by Request.Validate if the designated constraints aren't met.
func (RequestValidationError) Cause ¶
func (e RequestValidationError) Cause() error
Cause function returns cause value.
func (RequestValidationError) Error ¶
func (e RequestValidationError) Error() string
Error satisfies the builtin error interface
func (RequestValidationError) ErrorName ¶
func (e RequestValidationError) ErrorName() string
ErrorName returns error name.
func (RequestValidationError) Field ¶
func (e RequestValidationError) Field() string
Field function returns field value.
func (RequestValidationError) Key ¶
func (e RequestValidationError) Key() bool
Key function returns key value.
func (RequestValidationError) Reason ¶
func (e RequestValidationError) Reason() string
Reason function returns reason value.
type Response ¶
type Response struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` Chain []*Response_Chain `protobuf:"bytes,2,rep,name=chain,proto3" json:"chain,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Response) Descriptor ¶
func (*Response) GetChain ¶
func (m *Response) GetChain() []*Response_Chain
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) Validate ¶
Validate checks the field values on Response with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Response) XXX_DiscardUnknown ¶
func (m *Response) XXX_DiscardUnknown()
func (*Response) XXX_Marshal ¶
func (*Response) XXX_Unmarshal ¶
type ResponseValidationError ¶
type ResponseValidationError struct {
// contains filtered or unexported fields
}
ResponseValidationError is the validation error returned by Response.Validate if the designated constraints aren't met.
func (ResponseValidationError) Cause ¶
func (e ResponseValidationError) Cause() error
Cause function returns cause value.
func (ResponseValidationError) Error ¶
func (e ResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ResponseValidationError) ErrorName ¶
func (e ResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ResponseValidationError) Field ¶
func (e ResponseValidationError) Field() string
Field function returns field value.
func (ResponseValidationError) Key ¶
func (e ResponseValidationError) Key() bool
Key function returns key value.
func (ResponseValidationError) Reason ¶
func (e ResponseValidationError) Reason() string
Reason function returns reason value.
type Response_Chain ¶
type Response_Chain struct { Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` Ctx string `protobuf:"bytes,2,opt,name=ctx,proto3" json:"ctx,omitempty"` Chain []*Response_Chain `protobuf:"bytes,3,rep,name=chain,proto3" json:"chain,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Response_Chain) Descriptor ¶
func (*Response_Chain) Descriptor() ([]byte, []int)
func (*Response_Chain) GetChain ¶
func (m *Response_Chain) GetChain() []*Response_Chain
func (*Response_Chain) GetCtx ¶
func (m *Response_Chain) GetCtx() string
func (*Response_Chain) GetService ¶
func (m *Response_Chain) GetService() *Service
func (*Response_Chain) ProtoMessage ¶
func (*Response_Chain) ProtoMessage()
func (*Response_Chain) Reset ¶
func (m *Response_Chain) Reset()
func (*Response_Chain) String ¶
func (m *Response_Chain) String() string
func (*Response_Chain) Validate ¶
func (m *Response_Chain) Validate() error
Validate checks the field values on Response_Chain with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Response_Chain) XXX_DiscardUnknown ¶
func (m *Response_Chain) XXX_DiscardUnknown()
func (*Response_Chain) XXX_Marshal ¶
func (m *Response_Chain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Response_Chain) XXX_Merge ¶
func (m *Response_Chain) XXX_Merge(src proto.Message)
func (*Response_Chain) XXX_Size ¶
func (m *Response_Chain) XXX_Size() int
func (*Response_Chain) XXX_Unmarshal ¶
func (m *Response_Chain) XXX_Unmarshal(b []byte) error
type Response_ChainValidationError ¶
type Response_ChainValidationError struct {
// contains filtered or unexported fields
}
Response_ChainValidationError is the validation error returned by Response_Chain.Validate if the designated constraints aren't met.
func (Response_ChainValidationError) Cause ¶
func (e Response_ChainValidationError) Cause() error
Cause function returns cause value.
func (Response_ChainValidationError) Error ¶
func (e Response_ChainValidationError) Error() string
Error satisfies the builtin error interface
func (Response_ChainValidationError) ErrorName ¶
func (e Response_ChainValidationError) ErrorName() string
ErrorName returns error name.
func (Response_ChainValidationError) Field ¶
func (e Response_ChainValidationError) Field() string
Field function returns field value.
func (Response_ChainValidationError) Key ¶
func (e Response_ChainValidationError) Key() bool
Key function returns key value.
func (Response_ChainValidationError) Reason ¶
func (e Response_ChainValidationError) Reason() string
Reason function returns reason value.
type Service ¶
type Service struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` Node *Node `protobuf:"bytes,3,opt,name=node,proto3" json:"node,omitempty"` Services []*Service `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Service) Descriptor ¶
func (*Service) GetServices ¶
func (*Service) GetVersion ¶
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) Validate ¶
Validate checks the field values on Service with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Service) XXX_DiscardUnknown ¶
func (m *Service) XXX_DiscardUnknown()
func (*Service) XXX_Marshal ¶
func (*Service) XXX_Unmarshal ¶
type ServiceValidationError ¶
type ServiceValidationError struct {
// contains filtered or unexported fields
}
ServiceValidationError is the validation error returned by Service.Validate if the designated constraints aren't met.
func (ServiceValidationError) Cause ¶
func (e ServiceValidationError) Cause() error
Cause function returns cause value.
func (ServiceValidationError) Error ¶
func (e ServiceValidationError) Error() string
Error satisfies the builtin error interface
func (ServiceValidationError) ErrorName ¶
func (e ServiceValidationError) ErrorName() string
ErrorName returns error name.
func (ServiceValidationError) Field ¶
func (e ServiceValidationError) Field() string
Field function returns field value.
func (ServiceValidationError) Key ¶
func (e ServiceValidationError) Key() bool
Key function returns key value.
func (ServiceValidationError) Reason ¶
func (e ServiceValidationError) Reason() string
Reason function returns reason value.
type UnimplementedExampleServiceServer ¶
type UnimplementedExampleServiceServer struct { }
UnimplementedExampleServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedExampleServiceServer) ApiCall ¶
func (*UnimplementedExampleServiceServer) ApiCall(ctx context.Context, req *ApiRequest) (*Response, error)