endpoint

package
v0.0.0-...-09b6e72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: GPL-3.0 Imports: 8 Imported by: 2

Documentation

Overview

THIS FILE IS AUTO GENERATED BY GK-CLI DO NOT EDIT!!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstrumentingMiddleware

func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware

InstrumentingMiddleware returns an endpoint middleware that records the duration of each invocation to the passed histogram. The middleware adds a single field: "success", which is "true" if no error is returned, and "false" otherwise.

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.

func MakeProjectAbsentEndpoint

func MakeProjectAbsentEndpoint(s service.SimpleProjectionService) endpoint.Endpoint

MakeProjectAbsentEndpoint returns an endpoint that invokes ProjectAbsent on the service.

func MakeProjectAllEndpoint

func MakeProjectAllEndpoint(s service.SimpleProjectionService) endpoint.Endpoint

MakeProjectAllEndpoint returns an endpoint that invokes ProjectAll on the service.

func MakeProjectPresentEndpoint

func MakeProjectPresentEndpoint(s service.SimpleProjectionService) endpoint.Endpoint

MakeProjectPresentEndpoint returns an endpoint that invokes ProjectPresent on the service.

Types

type Endpoints

type Endpoints struct {
	ProjectAllEndpoint     endpoint.Endpoint
	ProjectPresentEndpoint endpoint.Endpoint
	ProjectAbsentEndpoint  endpoint.Endpoint
}

Endpoints collects all of the endpoints that compose a profile service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.

func New

New returns a Endpoints struct that wraps the provided service, and wires in all of the expected endpoint middlewares

func (Endpoints) ProjectAbsent

func (e Endpoints) ProjectAbsent(ctx context.Context, event string, day int, query model.Query) (rs []model.Participant, err error)

ProjectAbsent implements Service. Primarily useful in a client.

func (Endpoints) ProjectAll

func (e Endpoints) ProjectAll(ctx context.Context, event string, query model.Query) (rs []model.Participant, err error)

ProjectAll implements Service. Primarily useful in a client.

func (Endpoints) ProjectPresent

func (e Endpoints) ProjectPresent(ctx context.Context, event string, day int, query model.Query) (rs []model.Participant, err error)

ProjectPresent implements Service. Primarily useful in a client.

type Failure

type Failure interface {
	Failed() error
}

Failer is an interface that should be implemented by response types. Response encoders can check if responses are Failer, and if so they've failed, and if so encode them using a separate write path based on the error.

type ProjectAbsentRequest

type ProjectAbsentRequest struct {
	Event string      `json:"event"`
	Day   int         `json:"day"`
	Query model.Query `json:"query"`
}

ProjectAbsentRequest collects the request parameters for the ProjectAbsent method.

type ProjectAbsentResponse

type ProjectAbsentResponse struct {
	Rs  []model.Participant `json:"rs"`
	Err error               `json:"err"`
}

ProjectAbsentResponse collects the response parameters for the ProjectAbsent method.

func (ProjectAbsentResponse) Failed

func (r ProjectAbsentResponse) Failed() error

Failed implements Failer.

type ProjectAllRequest

type ProjectAllRequest struct {
	Event string      `json:"event"`
	Query model.Query `json:"query"`
}

ProjectAllRequest collects the request parameters for the ProjectAll method.

type ProjectAllResponse

type ProjectAllResponse struct {
	Rs  []model.Participant `json:"rs"`
	Err error               `json:"err"`
}

ProjectAllResponse collects the response parameters for the ProjectAll method.

func (ProjectAllResponse) Failed

func (r ProjectAllResponse) Failed() error

Failed implements Failer.

type ProjectPresentRequest

type ProjectPresentRequest struct {
	Event string      `json:"event"`
	Day   int         `json:"day"`
	Query model.Query `json:"query"`
}

ProjectPresentRequest collects the request parameters for the ProjectPresent method.

type ProjectPresentResponse

type ProjectPresentResponse struct {
	Rs  []model.Participant `json:"rs"`
	Err error               `json:"err"`
}

ProjectPresentResponse collects the response parameters for the ProjectPresent method.

func (ProjectPresentResponse) Failed

func (r ProjectPresentResponse) Failed() error

Failed implements Failer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL