endpoint

package
v0.0.0-...-4aec9fb Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: MIT Imports: 8 Imported by: 0

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 MakeGetReviewEndpoint

func MakeGetReviewEndpoint(s service.ReviewService) endpoint.Endpoint

MakeGetReviewEndpoint returns an endpoint that invokes GetReview on the service.

func MakeGetReviewsEndpoint

func MakeGetReviewsEndpoint(s service.ReviewService) endpoint.Endpoint

MakeGetReviewsEndpoint returns an endpoint that invokes GetReviews on the service.

func MakePostReviewEndpoint

func MakePostReviewEndpoint(s service.ReviewService) endpoint.Endpoint

MakePostReviewEndpoint returns an endpoint that invokes PostReview on the service.

func MakePutReviewEndpoint

func MakePutReviewEndpoint(s service.ReviewService) endpoint.Endpoint

MakePutReviewEndpoint returns an endpoint that invokes PutReview on the service.

Types

type Endpoints

type Endpoints struct {
	PostReviewEndpoint endpoint.Endpoint
	GetReviewEndpoint  endpoint.Endpoint
	GetReviewsEndpoint endpoint.Endpoint
	PutReviewEndpoint  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) GetReview

func (e Endpoints) GetReview(ctx context.Context, rid string) (status bool, errinfo string, data model.Review)

GetReview implements Service. Primarily useful in a client.

func (Endpoints) GetReviews

func (e Endpoints) GetReviews(ctx context.Context) (status bool, errinfo string, data []model.Review)

GetReviews implements Service. Primarily useful in a client.

func (Endpoints) PostReview

func (e Endpoints) PostReview(ctx context.Context, review model.Review) (status bool, errinfo string, data model.Review)

PostReview implements Service. Primarily useful in a client.

func (Endpoints) PutReview

func (e Endpoints) PutReview(ctx context.Context, rid string, review model.Review) (status bool, errinfo string, data model.Review)

PutReview implements Service. Primarily useful in a client.

type GetReviewRequest

type GetReviewRequest struct {
	Rid string `json:"rid"`
}

GetReviewRequest collects the request parameters for the GetReview method.

type GetReviewResponse

type GetReviewResponse struct {
	Status  bool         `json:"status"`
	Errinfo string       `json:"errinfo"`
	Data    model.Review `json:"data"`
}

GetReviewResponse collects the response parameters for the GetReview method.

type GetReviewsRequest

type GetReviewsRequest struct{}

GetReviewsRequest collects the request parameters for the GetReviews method.

type GetReviewsResponse

type GetReviewsResponse struct {
	Status  bool           `json:"status"`
	Errinfo string         `json:"errinfo"`
	Data    []model.Review `json:"data"`
}

GetReviewsResponse collects the response parameters for the GetReviews method.

type PostReviewRequest

type PostReviewRequest struct {
	Review model.Review `json:"review"`
}

PostReviewRequest collects the request parameters for the PostReview method.

type PostReviewResponse

type PostReviewResponse struct {
	Status  bool         `json:"status"`
	Errinfo string       `json:"errinfo"`
	Data    model.Review `json:"data"`
}

PostReviewResponse collects the response parameters for the PostReview method.

type PutReviewRequest

type PutReviewRequest struct {
	Rid    string       `json:"rid"`
	Review model.Review `json:"review"`
}

PutReviewRequest collects the request parameters for the PutReview method.

type PutReviewResponse

type PutReviewResponse struct {
	Status  bool         `json:"status"`
	Errinfo string       `json:"errinfo"`
	Data    model.Review `json:"data"`
}

PutReviewResponse collects the response parameters for the PutReview method.

Jump to

Keyboard shortcuts

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