Documentation ¶
Index ¶
- type EchoRequest
- type EchoResponse
- type EmbeddedHeader
- type ErrorMessage
- type ISampleServiceStub
- type MockOption
- type RedirectRequest
- type SampleServiceStub
- func (s SampleServiceStub) EchoGET(ctx context.Context, req *EchoRequest, opt ...stub.RESTOption) (*EchoResponse, *stub.Error)
- func (s SampleServiceStub) EchoPOST(ctx context.Context, req *EchoRequest, opt ...stub.RESTOption) (*EchoResponse, *stub.Error)
- func (s SampleServiceStub) Sum1(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error)
- func (s SampleServiceStub) Sum2(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error)
- func (s SampleServiceStub) SumRedirect(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error)
- type SampleServiceStubMock
- func (s SampleServiceStubMock) EchoGET(ctx context.Context, req *EchoRequest, opt ...stub.RESTOption) (*EchoResponse, *stub.Error)
- func (s SampleServiceStubMock) EchoPOST(ctx context.Context, req *EchoRequest, opt ...stub.RESTOption) (*EchoResponse, *stub.Error)
- func (s SampleServiceStubMock) Sum1(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error)
- func (s SampleServiceStubMock) Sum2(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error)
- func (s SampleServiceStubMock) SumRedirect(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error)
- type SumRequest
- type SumResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EchoRequest ¶
EchoRequest is a data transfer object
type EchoResponse ¶
EchoResponse is a data transfer object
type EmbeddedHeader ¶
EmbeddedHeader is a data transfer object
type ErrorMessage ¶
ErrorMessage is a data transfer object
func (ErrorMessage) GetCode ¶
func (x ErrorMessage) GetCode() int
func (ErrorMessage) GetItem ¶
func (x ErrorMessage) GetItem() string
type ISampleServiceStub ¶
type ISampleServiceStub interface { EchoGET( ctx context.Context, req *EchoRequest, opt ...stub.RESTOption, ) (*EchoResponse, *stub.Error) EchoPOST( ctx context.Context, req *EchoRequest, opt ...stub.RESTOption, ) (*EchoResponse, *stub.Error) Sum1( ctx context.Context, req *SumRequest, opt ...stub.RESTOption, ) (*SumResponse, *stub.Error) Sum2( ctx context.Context, req *SumRequest, opt ...stub.RESTOption, ) (*SumResponse, *stub.Error) SumRedirect( ctx context.Context, req *SumRequest, opt ...stub.RESTOption, ) (*SumResponse, *stub.Error) }
type MockOption ¶
type MockOption func(*SampleServiceStubMock)
func MockEchoGET ¶
func MockEchoGET( f func(ctx context.Context, req *EchoRequest, opt ...stub.RESTOption) (*EchoResponse, *stub.Error), ) MockOption
func MockEchoPOST ¶
func MockEchoPOST( f func(ctx context.Context, req *EchoRequest, opt ...stub.RESTOption) (*EchoResponse, *stub.Error), ) MockOption
func MockSum1 ¶
func MockSum1( f func(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error), ) MockOption
func MockSum2 ¶
func MockSum2( f func(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error), ) MockOption
func MockSumRedirect ¶
func MockSumRedirect( f func(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error), ) MockOption
type RedirectRequest ¶
type RedirectRequest struct {
URL string `json:"url"`
}
RedirectRequest is a data transfer object
type SampleServiceStub ¶
type SampleServiceStub struct {
// contains filtered or unexported fields
}
SampleServiceStub represents the client/stub for SampleService. Implements ISampleServiceStub
func NewSampleServiceStub ¶
func NewSampleServiceStub(hostPort string, opts ...stub.Option) *SampleServiceStub
func (SampleServiceStub) EchoGET ¶
func (s SampleServiceStub) EchoGET( ctx context.Context, req *EchoRequest, opt ...stub.RESTOption, ) (*EchoResponse, *stub.Error)
func (SampleServiceStub) EchoPOST ¶
func (s SampleServiceStub) EchoPOST( ctx context.Context, req *EchoRequest, opt ...stub.RESTOption, ) (*EchoResponse, *stub.Error)
func (SampleServiceStub) Sum1 ¶
func (s SampleServiceStub) Sum1( ctx context.Context, req *SumRequest, opt ...stub.RESTOption, ) (*SumResponse, *stub.Error)
func (SampleServiceStub) Sum2 ¶
func (s SampleServiceStub) Sum2( ctx context.Context, req *SumRequest, opt ...stub.RESTOption, ) (*SumResponse, *stub.Error)
func (SampleServiceStub) SumRedirect ¶
func (s SampleServiceStub) SumRedirect( ctx context.Context, req *SumRequest, opt ...stub.RESTOption, ) (*SumResponse, *stub.Error)
type SampleServiceStubMock ¶
type SampleServiceStubMock struct {
// contains filtered or unexported fields
}
SampleServiceStubMock represents the mocked for client/stub for SampleService. Implements ISampleServiceStub
func NewSampleServiceStubMock ¶
func NewSampleServiceStubMock(opts ...MockOption) *SampleServiceStubMock
func (SampleServiceStubMock) EchoGET ¶
func (s SampleServiceStubMock) EchoGET( ctx context.Context, req *EchoRequest, opt ...stub.RESTOption, ) (*EchoResponse, *stub.Error)
func (SampleServiceStubMock) EchoPOST ¶
func (s SampleServiceStubMock) EchoPOST( ctx context.Context, req *EchoRequest, opt ...stub.RESTOption, ) (*EchoResponse, *stub.Error)
func (SampleServiceStubMock) Sum1 ¶
func (s SampleServiceStubMock) Sum1( ctx context.Context, req *SumRequest, opt ...stub.RESTOption, ) (*SumResponse, *stub.Error)
func (SampleServiceStubMock) Sum2 ¶
func (s SampleServiceStubMock) Sum2( ctx context.Context, req *SumRequest, opt ...stub.RESTOption, ) (*SumResponse, *stub.Error)
func (SampleServiceStubMock) SumRedirect ¶
func (s SampleServiceStubMock) SumRedirect( ctx context.Context, req *SumRequest, opt ...stub.RESTOption, ) (*SumResponse, *stub.Error)
type SumRequest ¶
type SumRequest struct { EmbeddedHeader Val1 int64 `json:"val1"` Val2 int64 `json:"val2"` }
SumRequest is a data transfer object
type SumResponse ¶
type SumResponse struct { EmbeddedHeader Val int64 `json:"val"` }
SumResponse is a data transfer object
Click to show internal directories.
Click to hide internal directories.