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 MakeCancelLikeCommentEndpoint

func MakeCancelLikeCommentEndpoint(s service.CommentService) endpoint.Endpoint

MakeCancelLikeCommentEndpoint returns an endpoint that invokes CancelLikeComment on the service.

func MakeChangeCommentEndpoint

func MakeChangeCommentEndpoint(s service.CommentService) endpoint.Endpoint

MakeChangeCommentEndpoint returns an endpoint that invokes ChangeComment on the service.

func MakeDeleteCommentEndpoint

func MakeDeleteCommentEndpoint(s service.CommentService) endpoint.Endpoint

MakeDeleteCommentEndpoint returns an endpoint that invokes DeleteComment on the service.

func MakeGetCommentEndpoint

func MakeGetCommentEndpoint(s service.CommentService) endpoint.Endpoint

MakeGetCommentEndpoint returns an endpoint that invokes GetComment on the service.

func MakeLikeCommentEndpoint

func MakeLikeCommentEndpoint(s service.CommentService) endpoint.Endpoint

MakeLikeCommentEndpoint returns an endpoint that invokes LikeComment on the service.

func MakePostCommentEndpoint

func MakePostCommentEndpoint(s service.CommentService) endpoint.Endpoint

MakePostCommentEndpoint returns an endpoint that invokes PostComment on the service.

Types

type CancelLikeCommentRequest

type CancelLikeCommentRequest struct {
	TaskId string `json:"task_id"`
	CId    string `json:"cid"`
}

CancelLikeCommentRequest collects the request parameters for the CancelLikeComment method.

type CancelLikeCommentResponse

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

CancelLikeCommentResponse collects the response parameters for the CancelLikeComment method.

type ChangeCommentRequest

type ChangeCommentRequest struct {
	TaskId  string `json:"task_id"`
	CId     string `json:"cid"`
	Comment string `json:"comment"`
}

ChangeCommentRequest collects the request parameters for the ChangeComment method.

type ChangeCommentResponse

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

ChangeCommentResponse collects the response parameters for the ChangeComment method.

type DeleteCommentRequest

type DeleteCommentRequest struct {
	TaskId string `json:"task_id"`
	CId    string `json:"cid"`
}

DeleteCommentRequest collects the request parameters for the DeleteComment method.

type DeleteCommentResponse

type DeleteCommentResponse struct {
	Status  bool   `json:"status"`
	Errinfo string `json:"errinfo"`
	Data    string `json:"data"`
}

DeleteCommentResponse collects the response parameters for the DeleteComment method.

type Endpoints

type Endpoints struct {
	GetCommentEndpoint        endpoint.Endpoint
	PostCommentEndpoint       endpoint.Endpoint
	ChangeCommentEndpoint     endpoint.Endpoint
	DeleteCommentEndpoint     endpoint.Endpoint
	LikeCommentEndpoint       endpoint.Endpoint
	CancelLikeCommentEndpoint 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) CancelLikeComment

func (e Endpoints) CancelLikeComment(ctx context.Context, taskId string, cId string) (status bool, errinfo string, data *model.Comment)

CancelLikeComment implements Service. Primarily useful in a client.

func (Endpoints) ChangeComment

func (e Endpoints) ChangeComment(ctx context.Context, taskId string, cId string, comment string) (status bool, errinfo string, data *model.Comment)

ChangeComment implements Service. Primarily useful in a client.

func (Endpoints) DeleteComment

func (e Endpoints) DeleteComment(ctx context.Context, taskId string, cId string) (status bool, errinfo string, data string)

DeleteComment implements Service. Primarily useful in a client.

func (Endpoints) GetComment

func (e Endpoints) GetComment(ctx context.Context, taskId string) (status bool, errinfo string, data []model.Comment)

GetComment implements Service. Primarily useful in a client.

func (Endpoints) LikeComment

func (e Endpoints) LikeComment(ctx context.Context, taskId string, cId string) (status bool, errinfo string, data *model.Comment)

LikeComment implements Service. Primarily useful in a client.

func (Endpoints) PostComment

func (e Endpoints) PostComment(ctx context.Context, taskId string, comment string) (status bool, errinfo string, data *model.Comment)

PostComment implements Service. Primarily useful in a client.

type GetCommentRequest

type GetCommentRequest struct {
	TaskId string `json:"task_id"`
}

GetCommentRequest collects the request parameters for the GetComment method.

type GetCommentResponse

type GetCommentResponse struct {
	Status  bool            `json:"status"`
	Errinfo string          `json:"errinfo"`
	Data    []model.Comment `json:"data"`
}

GetCommentResponse collects the response parameters for the GetComment method.

type LikeCommentRequest

type LikeCommentRequest struct {
	TaskId string `json:"task_id"`
	CId    string `json:"cid"`
}

LikeCommentRequest collects the request parameters for the LikeComment method.

type LikeCommentResponse

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

LikeCommentResponse collects the response parameters for the LikeComment method.

type PostCommentRequest

type PostCommentRequest struct {
	TaskId  string `json:"task_id"`
	Comment string `json:"comment"`
}

PostCommentRequest collects the request parameters for the PostComment method.

type PostCommentResponse

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

PostCommentResponse collects the response parameters for the PostComment method.

Jump to

Keyboard shortcuts

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