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 MakeCreateGuestEndpoint

func MakeCreateGuestEndpoint(s service.GuestsService) endpoint.Endpoint

MakeCreateGuestEndpoint returns an endpoint that invokes CreateGuest on the service.

func MakeCreateSponsorEndpoint

func MakeCreateSponsorEndpoint(s service.GuestsService) endpoint.Endpoint

MakeCreateSponsorEndpoint returns an endpoint that invokes CreateSponsor on the service.

func MakeDeleteGuestEndpoint

func MakeDeleteGuestEndpoint(s service.GuestsService) endpoint.Endpoint

MakeDeleteGuestEndpoint returns an endpoint that invokes DeleteGuest on the service.

func MakeDeleteSponsorEndpoint

func MakeDeleteSponsorEndpoint(s service.GuestsService) endpoint.Endpoint

MakeDeleteSponsorEndpoint returns an endpoint that invokes DeleteSponsor on the service.

func MakeReadGuestEndpoint

func MakeReadGuestEndpoint(s service.GuestsService) endpoint.Endpoint

MakeReadGuestEndpoint returns an endpoint that invokes ReadGuest on the service.

func MakeReadSponsorEndpoint

func MakeReadSponsorEndpoint(s service.GuestsService) endpoint.Endpoint

MakeReadSponsorEndpoint returns an endpoint that invokes ReadSponsor on the service.

func MakeUpdateGuestEndpoint

func MakeUpdateGuestEndpoint(s service.GuestsService) endpoint.Endpoint

MakeUpdateGuestEndpoint returns an endpoint that invokes UpdateGuest on the service.

func MakeUpdateSponsorEndpoint

func MakeUpdateSponsorEndpoint(s service.GuestsService) endpoint.Endpoint

MakeUpdateSponsorEndpoint returns an endpoint that invokes UpdateSponsor on the service.

Types

type CreateGuestRequest

type CreateGuestRequest struct {
	Event string      `json:"event"`
	Guest model.Guest `json:"guest"`
}

CreateGuestRequest collects the request parameters for the CreateGuest method.

type CreateGuestResponse

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

CreateGuestResponse collects the response parameters for the CreateGuest method.

func (CreateGuestResponse) Failed

func (r CreateGuestResponse) Failed() error

Failed implements Failer.

type CreateSponsorRequest

type CreateSponsorRequest struct {
	Event   string            `json:"event"`
	Sponsor model.Participant `json:"sponsor"`
}

CreateSponsorRequest collects the request parameters for the CreateSponsor method.

type CreateSponsorResponse

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

CreateSponsorResponse collects the response parameters for the CreateSponsor method.

func (CreateSponsorResponse) Failed

func (r CreateSponsorResponse) Failed() error

Failed implements Failer.

type DeleteGuestRequest

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

DeleteGuestRequest collects the request parameters for the DeleteGuest method.

type DeleteGuestResponse

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

DeleteGuestResponse collects the response parameters for the DeleteGuest method.

func (DeleteGuestResponse) Failed

func (r DeleteGuestResponse) Failed() error

Failed implements Failer.

type DeleteSponsorRequest

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

DeleteSponsorRequest collects the request parameters for the DeleteSponsor method.

type DeleteSponsorResponse

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

DeleteSponsorResponse collects the response parameters for the DeleteSponsor method.

func (DeleteSponsorResponse) Failed

func (r DeleteSponsorResponse) Failed() error

Failed implements Failer.

type Endpoints

type Endpoints struct {
	CreateGuestEndpoint   endpoint.Endpoint
	ReadGuestEndpoint     endpoint.Endpoint
	UpdateGuestEndpoint   endpoint.Endpoint
	DeleteGuestEndpoint   endpoint.Endpoint
	CreateSponsorEndpoint endpoint.Endpoint
	ReadSponsorEndpoint   endpoint.Endpoint
	UpdateSponsorEndpoint endpoint.Endpoint
	DeleteSponsorEndpoint 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) CreateGuest

func (e Endpoints) CreateGuest(ctx context.Context, event string, guest model.Guest) (rs string, err error)

CreateGuest implements Service. Primarily useful in a client.

func (Endpoints) CreateSponsor

func (e Endpoints) CreateSponsor(ctx context.Context, event string, sponsor model.Participant) (rs string, err error)

CreateSponsor implements Service. Primarily useful in a client.

func (Endpoints) DeleteGuest

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

DeleteGuest implements Service. Primarily useful in a client.

func (Endpoints) DeleteSponsor

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

DeleteSponsor implements Service. Primarily useful in a client.

func (Endpoints) ReadGuest

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

ReadGuest implements Service. Primarily useful in a client.

func (Endpoints) ReadSponsor

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

ReadSponsor implements Service. Primarily useful in a client.

func (Endpoints) UpdateGuest

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

UpdateGuest implements Service. Primarily useful in a client.

func (Endpoints) UpdateSponsor

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

UpdateSponsor 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 ReadGuestRequest

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

ReadGuestRequest collects the request parameters for the ReadGuest method.

type ReadGuestResponse

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

ReadGuestResponse collects the response parameters for the ReadGuest method.

func (ReadGuestResponse) Failed

func (r ReadGuestResponse) Failed() error

Failed implements Failer.

type ReadSponsorRequest

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

ReadSponsorRequest collects the request parameters for the ReadSponsor method.

type ReadSponsorResponse

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

ReadSponsorResponse collects the response parameters for the ReadSponsor method.

func (ReadSponsorResponse) Failed

func (r ReadSponsorResponse) Failed() error

Failed implements Failer.

type UpdateGuestRequest

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

UpdateGuestRequest collects the request parameters for the UpdateGuest method.

type UpdateGuestResponse

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

UpdateGuestResponse collects the response parameters for the UpdateGuest method.

func (UpdateGuestResponse) Failed

func (r UpdateGuestResponse) Failed() error

Failed implements Failer.

type UpdateSponsorRequest

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

UpdateSponsorRequest collects the request parameters for the UpdateSponsor method.

type UpdateSponsorResponse

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

UpdateSponsorResponse collects the response parameters for the UpdateSponsor method.

func (UpdateSponsorResponse) Failed

func (r UpdateSponsorResponse) Failed() error

Failed implements Failer.

Jump to

Keyboard shortcuts

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