Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeStatusRequest ¶
ChangeStatusRequest holds the request parameters for the ChangeStatus method.
type ChangeStatusResponse ¶
type ChangeStatusResponse struct {
Err error `json:"error,omitempty"`
}
ChangeStatusResponse holds the response values for the ChangeStatus method.
func (ChangeStatusResponse) Error ¶
func (r ChangeStatusResponse) Error() error
func (ChangeStatusResponse) Failed ¶
func (r ChangeStatusResponse) Failed() error
Failed implements Failer
type CreateRequest ¶
CreateRequest holds the request parameters for the Create method.
type CreateResponse ¶
CreateResponse holds the response values for the Create method.
func (CreateResponse) Error ¶
func (r CreateResponse) Error() error
We have two options to return errors from the business logic.
We could return the error via the endpoint itself. That makes certain things a little bit easier, like providing non-200 HTTP responses to the client. But Go kit assumes that endpoint errors are (or may be treated as) transport-domain errors. For example, an endpoint error will count against a circuit breaker error count.
Therefore, it's often better to return service (business logic) errors in the response object. This means we have to do a bit more work in the HTTP response encoder to detect e.g. a not-found error and provide a proper HTTP status code. That work is done with the Errorer interface, in transport.go. Response types that may contain business-logic errors implement that interface.
type Endpoints ¶
type Endpoints struct { Create endpoint.Endpoint GetByID endpoint.Endpoint ChangeStatus endpoint.Endpoint }
Endpoints holds all Go kit endpoints for the Order service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.
func MakeEndpoints ¶
MakeEndpoints initializes all Go kit endpoints for the Order service.
type GetByIDRequest ¶
type GetByIDRequest struct {
ID string
}
GetByIDRequest holds the request parameters for the GetByID method.
type GetByIDResponse ¶
GetByIDResponse holds the response values for the GetByID method.
func (GetByIDResponse) Error ¶
func (r GetByIDResponse) Error() error