endpoint

package
v0.0.0-...-09b6e72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: GPL-3.0 Imports: 4 Imported by: 2

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 MakeCreateSchemaEndpoint

func MakeCreateSchemaEndpoint(s service.CouponsService) endpoint.Endpoint

MakeCreateSchemaEndpoint returns an endpoint that invokes CreateSchema on the service.

func MakeDeleteCouponEndpoint

func MakeDeleteCouponEndpoint(s service.CouponsService) endpoint.Endpoint

MakeDeleteCouponEndpoint returns an endpoint that invokes DeleteCoupon on the service.

func MakeDeleteSchemaEndpoint

func MakeDeleteSchemaEndpoint(s service.CouponsService) endpoint.Endpoint

MakeDeleteSchemaEndpoint returns an endpoint that invokes DeleteSchema on the service.

func MakeMarkPresentEndpoint

func MakeMarkPresentEndpoint(s service.CouponsService) endpoint.Endpoint

MakeMarkPresentEndpoint returns an endpoint that invokes MarkPresent on the service.

func MakeRedeemCouponEndpoint

func MakeRedeemCouponEndpoint(s service.CouponsService) endpoint.Endpoint

MakeRedeemCouponEndpoint returns an endpoint that invokes RedeemCoupon on the service.

func MakeViewSchemaEndpoint

func MakeViewSchemaEndpoint(s service.CouponsService) endpoint.Endpoint

MakeViewSchemaEndpoint returns an endpoint that invokes ViewSchema on the service.

Types

type CreateSchemaRequest

type CreateSchemaRequest struct {
	Event   string         `json:"event"`
	Coupons []model.Coupon `json:"coupons"`
}

CreateSchemaRequest collects the request parameters for the CreateSchema method.

type CreateSchemaResponse

type CreateSchemaResponse struct {
	Rs  string `json:"rs"`
	Err error  `json:"err"`
}

CreateSchemaResponse collects the response parameters for the CreateSchema method.

func (CreateSchemaResponse) Failed

func (r CreateSchemaResponse) Failed() error

Failed implements Failer.

type DeleteCouponRequest

type DeleteCouponRequest struct {
	Event  string       `json:"event"`
	Coupon model.Coupon `json:"coupon"`
}

DeleteCouponRequest collects the request parameters for the DeleteCoupon method.

type DeleteCouponResponse

type DeleteCouponResponse struct {
	Rs  string `json:"rs"`
	Err error  `json:"err"`
}

DeleteCouponResponse collects the response parameters for the DeleteCoupon method.

func (DeleteCouponResponse) Failed

func (r DeleteCouponResponse) Failed() error

Failed implements Failer.

type DeleteSchemaRequest

type DeleteSchemaRequest struct {
	Event string       `json:"event"`
	Query model.Coupon `json:"query"`
}

DeleteSchemaRequest collects the request parameters for the DeleteSchema method.

type DeleteSchemaResponse

type DeleteSchemaResponse struct {
	Rs  string `json:"rs"`
	Err error  `json:"err"`
}

DeleteSchemaResponse collects the response parameters for the DeleteSchema method.

func (DeleteSchemaResponse) Failed

func (r DeleteSchemaResponse) Failed() error

Failed implements Failer.

type Endpoints

type Endpoints struct {
	CreateSchemaEndpoint endpoint.Endpoint
	MarkPresentEndpoint  endpoint.Endpoint
	RedeemCouponEndpoint endpoint.Endpoint
	DeleteCouponEndpoint endpoint.Endpoint
	DeleteSchemaEndpoint endpoint.Endpoint
	ViewSchemaEndpoint   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) CreateSchema

func (e Endpoints) CreateSchema(ctx context.Context, event string, coupons []model.Coupon) (rs string, err error)

CreateSchema implements Service. Primarily useful in a client.

func (Endpoints) DeleteCoupon

func (e Endpoints) DeleteCoupon(ctx context.Context, event string, coupon model.Coupon) (rs string, err error)

DeleteCoupon implements Service. Primarily useful in a client.

func (Endpoints) DeleteSchema

func (e Endpoints) DeleteSchema(ctx context.Context, event string, query model.Coupon) (rs string, err error)

DeleteSchema implements Service. Primarily useful in a client.

func (Endpoints) MarkPresent

func (e Endpoints) MarkPresent(ctx context.Context, attendance model.Attendance) (rs string, err error)

MarkPresent implements Service. Primarily useful in a client.

func (Endpoints) RedeemCoupon

func (e Endpoints) RedeemCoupon(ctx context.Context, attendance model.Attendance, couponName string) (rs string, err error)

RedeemCoupon implements Service. Primarily useful in a client.

func (Endpoints) ViewSchema

func (e Endpoints) ViewSchema(ctx context.Context, event string) (rs []model.Coupon, err error)

ViewSchema implements Service. Primarily useful in a client.

type Failure

type Failure interface {
	Failed() error
}

Failer is an interface that should be implemented by response types. Response encoders can check if responses are Failer, and if so they've failed, and if so encode them using a separate write path based on the error.

type MarkPresentRequest

type MarkPresentRequest struct {
	Attendance model.Attendance `json:"attendance"`
}

MarkPresentRequest collects the request parameters for the MarkPresent method.

type MarkPresentResponse

type MarkPresentResponse struct {
	Rs  string `json:"rs"`
	Err error  `json:"err"`
}

MarkPresentResponse collects the response parameters for the MarkPresent method.

func (MarkPresentResponse) Failed

func (r MarkPresentResponse) Failed() error

Failed implements Failer.

type RedeemCouponRequest

type RedeemCouponRequest struct {
	Attendance model.Attendance `json:"attendance"`
	CouponName string           `json:"coupon_name"`
}

RedeemCouponRequest collects the request parameters for the RedeemCoupon method.

type RedeemCouponResponse

type RedeemCouponResponse struct {
	Rs  string `json:"rs"`
	Err error  `json:"err"`
}

RedeemCouponResponse collects the response parameters for the RedeemCoupon method.

func (RedeemCouponResponse) Failed

func (r RedeemCouponResponse) Failed() error

Failed implements Failer.

type ViewSchemaRequest

type ViewSchemaRequest struct {
	Event string `json:"event"`
}

ViewSchemaRequest collects the request parameters for the ViewSchema method.

type ViewSchemaResponse

type ViewSchemaResponse struct {
	Rs  []model.Coupon `json:"rs"`
	Err error          `json:"err"`
}

ViewSchemaResponse collects the response parameters for the ViewSchema method.

func (ViewSchemaResponse) Failed

func (r ViewSchemaResponse) Failed() error

Failed implements Failer.

Jump to

Keyboard shortcuts

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