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 MakeDeleteEndpoint(s service.UserService) endpoint.Endpoint
- func MakeGetAllEndpoint(s service.UserService) endpoint.Endpoint
- func MakeGetSpecEndpoint(s service.UserService) endpoint.Endpoint
- func MakeGetUDFEndpoint(s service.UserService) endpoint.Endpoint
- func MakePatchEndpoint(s service.UserService) endpoint.Endpoint
- func MakePostEndpoint(s service.UserService) endpoint.Endpoint
- func MakePutEndpoint(s service.UserService) endpoint.Endpoint
- type DeleteRequest
- type DeleteResponse
- type Endpoints
- func (e Endpoints) Delete(ctx context.Context, id string) (status bool, errinfo string, data *model.User)
- func (e Endpoints) GetAll(ctx context.Context) (status bool, errinfo string, data []model.User)
- func (e Endpoints) GetSpec(ctx context.Context, id string) (status bool, errinfo string, data *model.User)
- func (e Endpoints) GetUDF(ctx context.Context, name string) (status bool, errinfo string, data []model.User)
- func (e Endpoints) Patch(ctx context.Context, id string, user model.User) (status bool, errinfo string, data *model.User)
- func (e Endpoints) Post(ctx context.Context, user model.User) (status bool, errinfo string, data *model.User)
- func (e Endpoints) Put(ctx context.Context, id string, user model.User) (status bool, errinfo string, data *model.User)
- type GetAllRequest
- type GetAllResponse
- type GetSpecRequest
- type GetSpecResponse
- type GetUDFRequest
- type GetUDFResponse
- type PatchRequest
- type PatchResponse
- type PostRequest
- type PostResponse
- type PutRequest
- type PutResponse
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 MakeDeleteEndpoint ¶
func MakeDeleteEndpoint(s service.UserService) endpoint.Endpoint
MakeDeleteEndpoint returns an endpoint that invokes Delete on the service.
func MakeGetAllEndpoint ¶
func MakeGetAllEndpoint(s service.UserService) endpoint.Endpoint
MakeGetAllEndpoint returns an endpoint that invokes GetAll on the service.
func MakeGetSpecEndpoint ¶
func MakeGetSpecEndpoint(s service.UserService) endpoint.Endpoint
MakeGetSpecEndpoint returns an endpoint that invokes GetSpec on the service.
func MakeGetUDFEndpoint ¶
func MakeGetUDFEndpoint(s service.UserService) endpoint.Endpoint
MakeGetUDFEndpoint returns an endpoint that invokes GetUDF on the service.
func MakePatchEndpoint ¶
func MakePatchEndpoint(s service.UserService) endpoint.Endpoint
MakePatchEndpoint returns an endpoint that invokes Patch on the service.
func MakePostEndpoint ¶
func MakePostEndpoint(s service.UserService) endpoint.Endpoint
MakePostEndpoint returns an endpoint that invokes Post on the service.
func MakePutEndpoint ¶
func MakePutEndpoint(s service.UserService) endpoint.Endpoint
MakePutEndpoint returns an endpoint that invokes Put on the service.
Types ¶
type DeleteRequest ¶
type DeleteRequest struct {
Id string `json:"id"`
}
DeleteRequest collects the request parameters for the Delete method.
type DeleteResponse ¶
type DeleteResponse struct { Status bool `json:"status"` Errinfo string `json:"errinfo"` Data *model.User `json:"data"` }
DeleteResponse collects the response parameters for the Delete method.
type Endpoints ¶
type Endpoints struct { GetSpecEndpoint endpoint.Endpoint GetAllEndpoint endpoint.Endpoint GetUDFEndpoint endpoint.Endpoint PostEndpoint endpoint.Endpoint PatchEndpoint endpoint.Endpoint PutEndpoint endpoint.Endpoint DeleteEndpoint 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.UserService, 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) Delete ¶
func (e Endpoints) Delete(ctx context.Context, id string) (status bool, errinfo string, data *model.User)
Delete implements Service. Primarily useful in a client.
func (Endpoints) GetSpec ¶
func (e Endpoints) GetSpec(ctx context.Context, id string) (status bool, errinfo string, data *model.User)
GetSpec implements Service. Primarily useful in a client.
func (Endpoints) GetUDF ¶
func (e Endpoints) GetUDF(ctx context.Context, name string) (status bool, errinfo string, data []model.User)
GetUDF implements Service. Primarily useful in a client.
func (Endpoints) Patch ¶
func (e Endpoints) Patch(ctx context.Context, id string, user model.User) (status bool, errinfo string, data *model.User)
Patch implements Service. Primarily useful in a client.
type GetAllRequest ¶
type GetAllRequest struct { Page int `json:"page"` Offset int `json:"offset"` Limit int `json:"limit"` Orderby string `json:"orderby"` }
GetAllRequest collects the request parameters for the GetAll method.
type GetAllResponse ¶
type GetAllResponse struct { Status bool `json:"status"` Errinfo string `json:"errinfo"` Data []model.User `json:"data"` }
GetAllResponse collects the response parameters for the GetAll method.
type GetSpecRequest ¶
type GetSpecRequest struct {
Id string `json:"id"`
}
GetSpecRequest collects the request parameters for the GetSpec method.
type GetSpecResponse ¶
type GetSpecResponse struct { Status bool `json:"status"` Errinfo string `json:"errinfo"` Data *model.User `json:"data"` }
GetSpecResponse collects the response parameters for the GetSpec method.
type GetUDFRequest ¶
type GetUDFRequest struct { Name string `json:"name"` Page int `json:"page"` Offset int `json:"offset"` Limit int `json:"limit"` Orderby string `json:"orderby"` }
GetUDFRequest collects the request parameters for the GetUDF method.
type GetUDFResponse ¶
type GetUDFResponse struct { Status bool `json:"status"` Errinfo string `json:"errinfo"` Data []model.User `json:"data"` }
GetUDFResponse collects the response parameters for the GetUDF method.
type PatchRequest ¶
PatchRequest collects the request parameters for the Patch method.
type PatchResponse ¶
type PatchResponse struct { Status bool `json:"status"` Errinfo string `json:"errinfo"` Data *model.User `json:"data"` }
PatchResponse collects the response parameters for the Patch method.
type PostRequest ¶
PostRequest collects the request parameters for the Post method.
type PostResponse ¶
type PostResponse struct { Status bool `json:"status"` Errinfo string `json:"errinfo"` Data *model.User `json:"data"` }
PostResponse collects the response parameters for the Post method.
type PutRequest ¶
PutRequest collects the request parameters for the Put method.