Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) endpoint.Middleware
LoggingMiddleware returns an endpoint middleware that logs the duration of each invocation, and the resulting error, if any.
Types ¶
type Endpoints ¶
Endpoints collects all of the endpoints that compose the service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.
In a server, it's useful for functions that need to operate on a per-endpoint basis. For example, you might pass an Endpoints to a function that produces an http.Handler, with each method (endpoint) wired up to a specific path. (It is probably a mistake in design to invoke the Service methods on the Endpoints struct in a server.)
In a client, it's useful to collect individually constructed endpoints into a single type that implements the Service interface. For example, you might construct individual endpoints using transport/http.NewClient, combine them into an Endpoints, and return it to the caller as a Service.
func New ¶
New returns an Endpoints that wraps the provided server, and wires in all of the expected endpoint middlewares via the various parameters.
func (Endpoints) WorkflowGet ¶
WorkflowGet implements Service. Primarily useful in a client.
type WorkflowGetRequest ¶
type WorkflowGetRequest struct {
ID string
}
WorkflowGetRequest collects the request parameters for the WorkflowGet method.
type WorkflowGetResponse ¶
type WorkflowGetResponse struct { Workflow *pb.WorkflowData `json:"workflow,omitempty"` Err error `json:"err,omitempty"` }
WorkflowGetResponse collects the response values for the WorkflowGet method.
func (WorkflowGetResponse) Error ¶
func (r WorkflowGetResponse) Error() error