Documentation ¶
Index ¶
Constants ¶
View Source
const ( CaseInvalidMethod = "case: Invalid method" CaseClientIOError = "case: Client IO error" CaseNotImplemented = "case: Not implemented" CaseInfrastructureError = "case: infrastructure error" CaseServiceReturnedError = "case: Service returned an error" CaseContentTypeError = "case: Content type error" )
Variables ¶
View Source
var File_internal_test_test_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *duh.Client // contains filtered or unexported fields }
Client is a simple client that calls the Service
func NewClient ¶
func NewClient(conf ClientConfig) *Client
func (*Client) TestErrors ¶
func (c *Client) TestErrors(ctx context.Context, req *ErrorsRequest) error
TestErrors is used in test suite to test error handling
type ClientConfig ¶
type ErrorsRequest ¶
type ErrorsRequest struct { Case string `protobuf:"bytes,1,opt,name=case,proto3" json:"case,omitempty"` // contains filtered or unexported fields }
func (*ErrorsRequest) Descriptor
deprecated
func (*ErrorsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ErrorsRequest.ProtoReflect.Descriptor instead.
func (*ErrorsRequest) GetCase ¶
func (x *ErrorsRequest) GetCase() string
func (*ErrorsRequest) ProtoMessage ¶
func (*ErrorsRequest) ProtoMessage()
func (*ErrorsRequest) ProtoReflect ¶
func (x *ErrorsRequest) ProtoReflect() protoreflect.Message
func (*ErrorsRequest) Reset ¶
func (x *ErrorsRequest) Reset()
func (*ErrorsRequest) String ¶
func (x *ErrorsRequest) String() string
type Service ¶
type Service struct{}
Service is an example of a production ready service implementation
func (*Service) TestErrors ¶
func (h *Service) TestErrors(ctx context.Context, req *ErrorsRequest) error
TestErrors will return a variety of errors depending on the req.Case provided. Suitable for testing client implementations. This method only responds with errors.
Click to show internal directories.
Click to hide internal directories.