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

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

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

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

func (Endpoints) Post

func (e Endpoints) Post(ctx context.Context, user model.User) (status bool, errinfo string, data *model.User)

Post implements Service. Primarily useful in a client.

func (Endpoints) Put

func (e Endpoints) Put(ctx context.Context, id string, user model.User) (status bool, errinfo string, data *model.User)

Put 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

type PatchRequest struct {
	Id   string     `json:"id"`
	User model.User `json:"user"`
}

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

type PostRequest struct {
	User model.User `json:"user"`
}

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

type PutRequest struct {
	Id   string     `json:"id"`
	User model.User `json:"user"`
}

PutRequest collects the request parameters for the Put method.

type PutResponse

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

PutResponse collects the response parameters for the Put method.

Jump to

Keyboard shortcuts

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