Documentation ¶
Overview ¶
THIS FILE IS AUTO GENERATED BY GK-CLI DO NOT EDIT!!
Index ¶
- func MakeCreateSchemaEndpoint(s service.CouponsService) endpoint.Endpoint
- func MakeDeleteCouponEndpoint(s service.CouponsService) endpoint.Endpoint
- func MakeDeleteSchemaEndpoint(s service.CouponsService) endpoint.Endpoint
- func MakeMarkPresentEndpoint(s service.CouponsService) endpoint.Endpoint
- func MakeRedeemCouponEndpoint(s service.CouponsService) endpoint.Endpoint
- func MakeViewSchemaEndpoint(s service.CouponsService) endpoint.Endpoint
- type CreateSchemaRequest
- type CreateSchemaResponse
- type DeleteCouponRequest
- type DeleteCouponResponse
- type DeleteSchemaRequest
- type DeleteSchemaResponse
- type Endpoints
- func (e Endpoints) CreateSchema(ctx context.Context, event string, coupons []model.Coupon) (rs string, err error)
- func (e Endpoints) DeleteCoupon(ctx context.Context, event string, coupon model.Coupon) (rs string, err error)
- func (e Endpoints) DeleteSchema(ctx context.Context, event string, query model.Coupon) (rs string, err error)
- func (e Endpoints) MarkPresent(ctx context.Context, attendance model.Attendance) (rs string, err error)
- func (e Endpoints) RedeemCoupon(ctx context.Context, attendance model.Attendance, couponName string) (rs string, err error)
- func (e Endpoints) ViewSchema(ctx context.Context, event string) (rs []model.Coupon, err error)
- type Failure
- type MarkPresentRequest
- type MarkPresentResponse
- type RedeemCouponRequest
- type RedeemCouponResponse
- type ViewSchemaRequest
- type ViewSchemaResponse
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 ¶
CreateSchemaResponse collects the response parameters for the CreateSchema method.
func (CreateSchemaResponse) Failed ¶
func (r CreateSchemaResponse) Failed() error
Failed implements Failer.
type DeleteCouponRequest ¶
DeleteCouponRequest collects the request parameters for the DeleteCoupon method.
type DeleteCouponResponse ¶
DeleteCouponResponse collects the response parameters for the DeleteCoupon method.
func (DeleteCouponResponse) Failed ¶
func (r DeleteCouponResponse) Failed() error
Failed implements Failer.
type DeleteSchemaRequest ¶
DeleteSchemaRequest collects the request parameters for the DeleteSchema method.
type DeleteSchemaResponse ¶
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 ¶
func New(s service.CouponsService, 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) 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.
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 ¶
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 ¶
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 ¶
ViewSchemaResponse collects the response parameters for the ViewSchema method.
func (ViewSchemaResponse) Failed ¶
func (r ViewSchemaResponse) Failed() error
Failed implements Failer.