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 MakeCreateEventEndpoint

func MakeCreateEventEndpoint(s service.EventsService) endpoint.Endpoint

MakeCreateEventEndpoint returns an endpoint that invokes CreateEvent on the service.

func MakeDeleteEventEndpoint

func MakeDeleteEventEndpoint(s service.EventsService) endpoint.Endpoint

MakeDeleteEventEndpoint returns an endpoint that invokes DeleteEvent on the service.

func MakeReadEventEndpoint

func MakeReadEventEndpoint(s service.EventsService) endpoint.Endpoint

MakeReadEventEndpoint returns an endpoint that invokes ReadEvent on the service.

func MakeUpdateEventEndpoint

func MakeUpdateEventEndpoint(s service.EventsService) endpoint.Endpoint

MakeUpdateEventEndpoint returns an endpoint that invokes UpdateEvent on the service.

Types

type CreateEventRequest

type CreateEventRequest struct {
	Event model.Event `json:"event"`
}

CreateEventRequest collects the request parameters for the CreateEvent method.

type CreateEventResponse

type CreateEventResponse struct {
	Rs  string `json:"rs"`
	Err error  `json:"err"`
}

CreateEventResponse collects the response parameters for the CreateEvent method.

func (CreateEventResponse) Failed

func (r CreateEventResponse) Failed() error

Failed implements Failer.

type DeleteEventRequest

type DeleteEventRequest struct {
	Query model.Query `json:"query"`
}

DeleteEventRequest collects the request parameters for the DeleteEvent method.

type DeleteEventResponse

type DeleteEventResponse struct {
	Rs  string `json:"rs"`
	Err error  `json:"err"`
}

DeleteEventResponse collects the response parameters for the DeleteEvent method.

func (DeleteEventResponse) Failed

func (r DeleteEventResponse) Failed() error

Failed implements Failer.

type Endpoints

type Endpoints struct {
	CreateEventEndpoint endpoint.Endpoint
	ReadEventEndpoint   endpoint.Endpoint
	UpdateEventEndpoint endpoint.Endpoint
	DeleteEventEndpoint 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) CreateEvent

func (e Endpoints) CreateEvent(ctx context.Context, event model.Event) (rs string, err error)

CreateEvent implements Service. Primarily useful in a client.

func (Endpoints) DeleteEvent

func (e Endpoints) DeleteEvent(ctx context.Context, query model.Query) (rs string, err error)

DeleteEvent implements Service. Primarily useful in a client.

func (Endpoints) ReadEvent

func (e Endpoints) ReadEvent(ctx context.Context, query model.Query) (rs []model.Event, err error)

ReadEvent implements Service. Primarily useful in a client.

func (Endpoints) UpdateEvent

func (e Endpoints) UpdateEvent(ctx context.Context, query model.Query) (rs string, err error)

UpdateEvent 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 ReadEventRequest

type ReadEventRequest struct {
	Query model.Query `json:"query"`
}

ReadEventRequest collects the request parameters for the ReadEvent method.

type ReadEventResponse

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

ReadEventResponse collects the response parameters for the ReadEvent method.

func (ReadEventResponse) Failed

func (r ReadEventResponse) Failed() error

Failed implements Failer.

type UpdateEventRequest

type UpdateEventRequest struct {
	Query model.Query `json:"query"`
}

UpdateEventRequest collects the request parameters for the UpdateEvent method.

type UpdateEventResponse

type UpdateEventResponse struct {
	Rs  string `json:"rs"`
	Err error  `json:"err"`
}

UpdateEventResponse collects the response parameters for the UpdateEvent method.

func (UpdateEventResponse) Failed

func (r UpdateEventResponse) Failed() error

Failed implements Failer.

Jump to

Keyboard shortcuts

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