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

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.

func (Endpoints) PostAcceptDeal

func (e Endpoints) PostAcceptDeal(ctx context.Context, deal model.Deal) (status bool, errinfo string, data model.Deal)

PostAcceptDeal implements Service. Primarily useful in a client.

func (Endpoints) PutDealState

func (e Endpoints) PutDealState(ctx context.Context, deal model.Deal) (status bool, errinfo string, data *model.Deal)

PutDealState 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

type GetUserDealByStateRequest struct {
	Id    string `json:"id"`
	State string `json:"state"`
}

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

type PostAcceptDealRequest struct {
	Deal model.Deal `json:"deal"`
}

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

type PutDealStateRequest struct {
	Deal model.Deal `json:"deal"`
}

PutDealStateRequest collects the request parameters for the PutDealState method.

type PutDealStateResponse

type PutDealStateResponse struct {
	Status  bool        `json:"status"`
	Errinfo string      `json:"errinfo"`
	Data    *model.Deal `json:"data"`
}

PutDealStateResponse collects the response parameters for the PutDealState method.

Jump to

Keyboard shortcuts

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