Documentation ¶
Overview ¶
Package grpc_mock_api is a generated protocol buffer package.
It is generated from these files:
mock.proto
It has these top-level messages:
AddStubsRequest AddStubsResponse FindStubsRequest FindStubsResponse DeleteStubsRequest DeleteStubsResponse Stub Input Output
Package grpc_mock_api is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterMockHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMockHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MockClient) error
- func RegisterMockHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMockHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MockServer) error
- func RegisterMockServer(s *grpc.Server, srv MockServer)
- type AddStubsRequest
- type AddStubsResponse
- type DeleteStubsRequest
- type DeleteStubsResponse
- type FindStubsRequest
- func (*FindStubsRequest) Descriptor() ([]byte, []int)
- func (m *FindStubsRequest) GetIn() *google_protobuf1.Struct
- func (m *FindStubsRequest) GetMethod() string
- func (m *FindStubsRequest) GetService() string
- func (*FindStubsRequest) ProtoMessage()
- func (m *FindStubsRequest) Reset()
- func (m *FindStubsRequest) String() string
- type FindStubsResponse
- type Input
- func (*Input) Descriptor() ([]byte, []int)
- func (m *Input) GetContains() *google_protobuf1.Struct
- func (m *Input) GetEquals() *google_protobuf1.Struct
- func (m *Input) GetMatches() *google_protobuf1.Struct
- func (m *Input) GetRule() isInput_Rule
- func (*Input) ProtoMessage()
- func (m *Input) Reset()
- func (m *Input) String() string
- func (*Input) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type Input_Contains
- type Input_Equals
- type Input_Matches
- type MockClient
- type MockServer
- type Output
- type Stub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMockHandler ¶
RegisterMockHandler registers the http handlers for service Mock to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMockHandlerClient ¶
RegisterMockHandlerClient registers the http handlers for service Mock to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MockClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MockClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MockClient" to call the correct interceptors.
func RegisterMockHandlerFromEndpoint ¶
func RegisterMockHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterMockHandlerFromEndpoint is same as RegisterMockHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMockHandlerServer ¶
RegisterMockHandlerServer registers the http handlers for service Mock to "mux". UnaryRPC :call MockServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterMockServer ¶
func RegisterMockServer(s *grpc.Server, srv MockServer)
Types ¶
type AddStubsRequest ¶
type AddStubsRequest struct {
Stubs []*Stub `protobuf:"bytes,1,rep,name=stubs" json:"stubs,omitempty"`
}
func (*AddStubsRequest) Descriptor ¶
func (*AddStubsRequest) Descriptor() ([]byte, []int)
func (*AddStubsRequest) GetStubs ¶
func (m *AddStubsRequest) GetStubs() []*Stub
func (*AddStubsRequest) ProtoMessage ¶
func (*AddStubsRequest) ProtoMessage()
func (*AddStubsRequest) Reset ¶
func (m *AddStubsRequest) Reset()
func (*AddStubsRequest) String ¶
func (m *AddStubsRequest) String() string
type AddStubsResponse ¶
type AddStubsResponse struct { }
func (*AddStubsResponse) Descriptor ¶
func (*AddStubsResponse) Descriptor() ([]byte, []int)
func (*AddStubsResponse) ProtoMessage ¶
func (*AddStubsResponse) ProtoMessage()
func (*AddStubsResponse) Reset ¶
func (m *AddStubsResponse) Reset()
func (*AddStubsResponse) String ¶
func (m *AddStubsResponse) String() string
type DeleteStubsRequest ¶
type DeleteStubsRequest struct { Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` Method string `protobuf:"bytes,2,opt,name=method" json:"method,omitempty"` }
func (*DeleteStubsRequest) Descriptor ¶
func (*DeleteStubsRequest) Descriptor() ([]byte, []int)
func (*DeleteStubsRequest) GetMethod ¶
func (m *DeleteStubsRequest) GetMethod() string
func (*DeleteStubsRequest) GetService ¶
func (m *DeleteStubsRequest) GetService() string
func (*DeleteStubsRequest) ProtoMessage ¶
func (*DeleteStubsRequest) ProtoMessage()
func (*DeleteStubsRequest) Reset ¶
func (m *DeleteStubsRequest) Reset()
func (*DeleteStubsRequest) String ¶
func (m *DeleteStubsRequest) String() string
type DeleteStubsResponse ¶
type DeleteStubsResponse struct { }
func (*DeleteStubsResponse) Descriptor ¶
func (*DeleteStubsResponse) Descriptor() ([]byte, []int)
func (*DeleteStubsResponse) ProtoMessage ¶
func (*DeleteStubsResponse) ProtoMessage()
func (*DeleteStubsResponse) Reset ¶
func (m *DeleteStubsResponse) Reset()
func (*DeleteStubsResponse) String ¶
func (m *DeleteStubsResponse) String() string
type FindStubsRequest ¶
type FindStubsRequest struct { Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` Method string `protobuf:"bytes,2,opt,name=method" json:"method,omitempty"` In *google_protobuf1.Struct `protobuf:"bytes,3,opt,name=in" json:"in,omitempty"` }
func (*FindStubsRequest) Descriptor ¶
func (*FindStubsRequest) Descriptor() ([]byte, []int)
func (*FindStubsRequest) GetIn ¶
func (m *FindStubsRequest) GetIn() *google_protobuf1.Struct
func (*FindStubsRequest) GetMethod ¶
func (m *FindStubsRequest) GetMethod() string
func (*FindStubsRequest) GetService ¶
func (m *FindStubsRequest) GetService() string
func (*FindStubsRequest) ProtoMessage ¶
func (*FindStubsRequest) ProtoMessage()
func (*FindStubsRequest) Reset ¶
func (m *FindStubsRequest) Reset()
func (*FindStubsRequest) String ¶
func (m *FindStubsRequest) String() string
type FindStubsResponse ¶
type FindStubsResponse struct {
Stubs []*Stub `protobuf:"bytes,1,rep,name=stubs" json:"stubs,omitempty"`
}
func (*FindStubsResponse) Descriptor ¶
func (*FindStubsResponse) Descriptor() ([]byte, []int)
func (*FindStubsResponse) GetStubs ¶
func (m *FindStubsResponse) GetStubs() []*Stub
func (*FindStubsResponse) ProtoMessage ¶
func (*FindStubsResponse) ProtoMessage()
func (*FindStubsResponse) Reset ¶
func (m *FindStubsResponse) Reset()
func (*FindStubsResponse) String ¶
func (m *FindStubsResponse) String() string
type Input ¶
type Input struct { // Types that are valid to be assigned to Rule: // *Input_Equals // *Input_Contains // *Input_Matches Rule isInput_Rule `protobuf_oneof:"rule"` }
func (*Input) Descriptor ¶
func (*Input) GetContains ¶
func (m *Input) GetContains() *google_protobuf1.Struct
func (*Input) GetEquals ¶
func (m *Input) GetEquals() *google_protobuf1.Struct
func (*Input) GetMatches ¶
func (m *Input) GetMatches() *google_protobuf1.Struct
func (*Input) ProtoMessage ¶
func (*Input) ProtoMessage()
type Input_Contains ¶
type Input_Contains struct {
Contains *google_protobuf1.Struct `protobuf:"bytes,2,opt,name=contains,oneof"`
}
type Input_Equals ¶
type Input_Equals struct {
Equals *google_protobuf1.Struct `protobuf:"bytes,1,opt,name=equals,oneof"`
}
type Input_Matches ¶
type Input_Matches struct {
Matches *google_protobuf1.Struct `protobuf:"bytes,3,opt,name=matches,oneof"`
}
type MockClient ¶
type MockClient interface { AddStubs(ctx context.Context, in *AddStubsRequest, opts ...grpc.CallOption) (*AddStubsResponse, error) FindStubs(ctx context.Context, in *FindStubsRequest, opts ...grpc.CallOption) (*FindStubsResponse, error) DeleteStubs(ctx context.Context, in *DeleteStubsRequest, opts ...grpc.CallOption) (*DeleteStubsResponse, error) }
func NewMockClient ¶
func NewMockClient(cc *grpc.ClientConn) MockClient
type MockServer ¶
type MockServer interface { AddStubs(context.Context, *AddStubsRequest) (*AddStubsResponse, error) FindStubs(context.Context, *FindStubsRequest) (*FindStubsResponse, error) DeleteStubs(context.Context, *DeleteStubsRequest) (*DeleteStubsResponse, error) }
type Output ¶
type Output struct { Data *google_protobuf1.Struct `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` Code int32 `protobuf:"varint,2,opt,name=code" json:"code,omitempty"` Error string `protobuf:"bytes,3,opt,name=error" json:"error,omitempty"` }
func (*Output) Descriptor ¶
func (*Output) GetData ¶
func (m *Output) GetData() *google_protobuf1.Struct
func (*Output) ProtoMessage ¶
func (*Output) ProtoMessage()
type Stub ¶
type Stub struct { Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` Method string `protobuf:"bytes,2,opt,name=method" json:"method,omitempty"` In *Input `protobuf:"bytes,3,opt,name=in" json:"in,omitempty"` Out *Output `protobuf:"bytes,4,opt,name=out" json:"out,omitempty"` }
func (*Stub) Descriptor ¶
func (*Stub) GetService ¶
func (*Stub) ProtoMessage ¶
func (*Stub) ProtoMessage()