Documentation ¶
Overview ¶
THIS FILE IS AUTO GENERATED BY GK-CLI DO NOT EDIT!!
Index ¶
- func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware
- func LoggingMiddleware(logger log.Logger) endpoint.Middleware
- func MakeGetReviewEndpoint(s service.ReviewService) endpoint.Endpoint
- func MakeGetReviewsEndpoint(s service.ReviewService) endpoint.Endpoint
- func MakePostReviewEndpoint(s service.ReviewService) endpoint.Endpoint
- func MakePutReviewEndpoint(s service.ReviewService) endpoint.Endpoint
- type Endpoints
- func (e Endpoints) GetReview(ctx context.Context, rid string) (status bool, errinfo string, data model.Review)
- func (e Endpoints) GetReviews(ctx context.Context) (status bool, errinfo string, data []model.Review)
- func (e Endpoints) PostReview(ctx context.Context, review model.Review) (status bool, errinfo string, data model.Review)
- func (e Endpoints) PutReview(ctx context.Context, rid string, review model.Review) (status bool, errinfo string, data model.Review)
- type GetReviewRequest
- type GetReviewResponse
- type GetReviewsRequest
- type GetReviewsResponse
- type PostReviewRequest
- type PostReviewResponse
- type PutReviewRequest
- type PutReviewResponse
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 ¶
func New(s service.ReviewService, mdw map[string][]endpoint.Middleware) Endpoints
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.
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 ¶
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 ¶
PutReviewRequest collects the request parameters for the PutReview method.