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 MakeGetDealByDIDEndpoint(s service.DealService) endpoint.Endpoint
- func MakeGetDealByStateEndpoint(s service.DealService) endpoint.Endpoint
- func MakeGetUserDealByStateEndpoint(s service.DealService) endpoint.Endpoint
- func MakePostAcceptDealEndpoint(s service.DealService) endpoint.Endpoint
- func MakePutDealStateEndpoint(s service.DealService) endpoint.Endpoint
- type Endpoints
- func (e Endpoints) GetDealByDID(ctx context.Context, id string) (status bool, errinfo string, data model.Deal)
- func (e Endpoints) GetDealByState(ctx context.Context, state string) (status bool, errinfo string, data []model.Deal)
- func (e Endpoints) GetUserDealByState(ctx context.Context, id string, state string) (status bool, errinfo string, data []model.Deal)
- func (e Endpoints) PostAcceptDeal(ctx context.Context, deal model.Deal) (status bool, errinfo string, data model.Deal)
- func (e Endpoints) PutDealState(ctx context.Context, deal model.Deal) (status bool, errinfo string, data *model.Deal)
- type GetDealByDIDRequest
- type GetDealByDIDResponse
- type GetDealByStateRequest
- type GetDealByStateResponse
- type GetUserDealByStateRequest
- type GetUserDealByStateResponse
- type PostAcceptDealRequest
- type PostAcceptDealResponse
- type PutDealStateRequest
- type PutDealStateResponse
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 MakeGetDealByDIDEndpoint ¶
func MakeGetDealByDIDEndpoint(s service.DealService) endpoint.Endpoint
MakeGetDealByDIDEndpoint returns an endpoint that invokes GetDealByDID on the service.
func MakeGetDealByStateEndpoint ¶
func MakeGetDealByStateEndpoint(s service.DealService) endpoint.Endpoint
MakeGetDealByStateEndpoint returns an endpoint that invokes GetDealByState on the service.
func MakeGetUserDealByStateEndpoint ¶
func MakeGetUserDealByStateEndpoint(s service.DealService) endpoint.Endpoint
MakeGetUserDealByStateEndpoint returns an endpoint that invokes GetUserDealByState on the service.
func MakePostAcceptDealEndpoint ¶
func MakePostAcceptDealEndpoint(s service.DealService) endpoint.Endpoint
MakePostAcceptDealEndpoint returns an endpoint that invokes PostAcceptDeal on the service.
func MakePutDealStateEndpoint ¶
func MakePutDealStateEndpoint(s service.DealService) endpoint.Endpoint
MakePutDealStateEndpoint returns an endpoint that invokes PutDealState on the service.
Types ¶
type Endpoints ¶
type Endpoints struct { GetUserDealByStateEndpoint endpoint.Endpoint GetDealByDIDEndpoint endpoint.Endpoint GetDealByStateEndpoint endpoint.Endpoint PostAcceptDealEndpoint endpoint.Endpoint PutDealStateEndpoint 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.DealService, 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) GetDealByDID ¶
func (e Endpoints) GetDealByDID(ctx context.Context, id string) (status bool, errinfo string, data model.Deal)
GetDealByDID implements Service. Primarily useful in a client.
func (Endpoints) GetDealByState ¶
func (e Endpoints) GetDealByState(ctx context.Context, state string) (status bool, errinfo string, data []model.Deal)
GetDealByState implements Service. Primarily useful in a client.
func (Endpoints) GetUserDealByState ¶
func (e Endpoints) GetUserDealByState(ctx context.Context, id string, state string) (status bool, errinfo string, data []model.Deal)
GetUserDealByState implements Service. Primarily useful in a client.
type GetDealByDIDRequest ¶
type GetDealByDIDRequest struct {
Id string `json:"id"`
}
GetDealByDIDRequest collects the request parameters for the GetDealByDID method.
type GetDealByDIDResponse ¶
type GetDealByDIDResponse struct { Status bool `json:"status"` Errinfo string `json:"errinfo"` Data model.Deal `json:"data"` }
GetDealByDIDResponse collects the response parameters for the GetDealByDID method.
type GetDealByStateRequest ¶
type GetDealByStateRequest struct {
State string `json:"state"`
}
GetDealByStateRequest collects the request parameters for the GetDealByState method.
type GetDealByStateResponse ¶
type GetDealByStateResponse struct { Status bool `json:"status"` Errinfo string `json:"errinfo"` Data []model.Deal `json:"data"` }
GetDealByStateResponse collects the response parameters for the GetDealByState method.
type GetUserDealByStateRequest ¶
GetUserDealByStateRequest collects the request parameters for the GetUserDealByState method.
type GetUserDealByStateResponse ¶
type GetUserDealByStateResponse struct { Status bool `json:"status"` Errinfo string `json:"errinfo"` Data []model.Deal `json:"data"` }
GetUserDealByStateResponse collects the response parameters for the GetUserDealByState method.
type PostAcceptDealRequest ¶
PostAcceptDealRequest collects the request parameters for the PostAcceptDeal method.
type PostAcceptDealResponse ¶
type PostAcceptDealResponse struct { Status bool `json:"status"` Errinfo string `json:"errinfo"` Data model.Deal `json:"data"` }
PostAcceptDealResponse collects the response parameters for the PostAcceptDeal method.
type PutDealStateRequest ¶
PutDealStateRequest collects the request parameters for the PutDealState method.