handlers

package
v0.0.0-...-aa999d4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Customer

type Customer struct {
	*handlers.BaseHandler
	Customer *helpers.Customer
	Plan     *helpers.Plan
	Roaster  *helpers.Roaster
}

Customer implements CustomerI using stripe and coinage helpers

func (*Customer) Delete

func (c *Customer) Delete(ctx *gin.Context)

Delete implements CustomerI.Delete

func (*Customer) New

func (c *Customer) New(ctx *gin.Context)

New implements CustomerI.New

func (*Customer) Subscribe

func (c *Customer) Subscribe(ctx *gin.Context)

Subscribe implements CustomerI.Subscribe

func (*Customer) Unsubscribe

func (c *Customer) Unsubscribe(ctx *gin.Context)

Unsubscribe is not implemented

func (*Customer) View

func (c *Customer) View(ctx *gin.Context)

View implments CustomerI.View

func (*Customer) ViewAll

func (c *Customer) ViewAll(ctx *gin.Context)

ViewAll implements CustomerI.ViewAll

type CustomerI

type CustomerI interface {
	/*New creates a new customer or updates the payment info, sending it back on success*/
	New(ctx *gin.Context)
	/*View sends the customer with the given ID as a response*/
	View(ctx *gin.Context)
	/*View all sends a list of customers*/
	ViewAll(ctx *gin.Context)
	/*Delete removes the customer with the given ID*/
	Delete(ctx *gin.Context)
	/*Subscribe creates a new subscription for the cusutomer*/
	Subscribe(ctx *gin.Context)
	/*Unsubscribe removes a sucbsription from a customer*/
	Unsubscribe(ctx *gin.Context)
	/*Time tracks the length of execution for each call in the handler*/
	Time() gin.HandlerFunc
	/*GetJWT checks the JWT of a request*/
	GetJWT() gin.HandlerFunc
}

CustomerI describes the customer handler interface

func NewCustomer

func NewCustomer(ctx *handlers.GatewayContext) CustomerI

NewCustomer creates and returns a new customer using the given context

type Event

type Event struct {
	*handlers.BaseHandler
	Plan    *helpers.Plan
	Roaster *helpers.Roaster
	Event   helpers.Event
}

Event implements EventI with coinage helpers

func (*Event) Handle

func (e *Event) Handle(ctx *gin.Context)

type EventI

type EventI interface {
	Handle(*gin.Context)
	/*Time tracks the length of execution for each call in the handler*/
	Time() gin.HandlerFunc
}

EventI handles webhook requests from stripe

func NewEvent

func NewEvent(ctx *handlers.GatewayContext) EventI

NewEvent initializes and returns a plan with the given gateways

type Plan

type Plan struct {
	*handlers.BaseHandler
	Plan    *helpers.Plan
	Roaster *helpers.Roaster
}

Plan implements PlanI with coinage helpers

func (*Plan) Delete

func (p *Plan) Delete(ctx *gin.Context)

Delete implements PlanI.Delete

func (*Plan) New

func (p *Plan) New(ctx *gin.Context)

New implements PlanI.New

func (*Plan) Update

func (p *Plan) Update(ctx *gin.Context)

Update implements PlanI.Update

func (*Plan) View

func (p *Plan) View(ctx *gin.Context)

View implements PlanI.View

func (*Plan) ViewAll

func (p *Plan) ViewAll(ctx *gin.Context)

ViewAll implements PlanI.ViewAll

type PlanI

type PlanI interface {
	/*New creates a new plan associated with a given roaster*/
	New(ctx *gin.Context)
	/*view returns details a about all plans for a given roaster*/
	View(ctx *gin.Context)
	/*ViewAll returns a list of all available plans*/
	ViewAll(ctx *gin.Context)
	/*Update resets the plan information*/
	Update(ctx *gin.Context)
	/*Delete removes the plan*/
	Delete(ctx *gin.Context)
	/*Time tracks the length of execution for each call in the handler*/
	Time() gin.HandlerFunc
	/*GetJWT checks the JWT of a request*/
	GetJWT() gin.HandlerFunc
}

PlanI describes the requests about billing plans that

can be handled

func NewPlan

func NewPlan(ctx *handlers.GatewayContext) PlanI

NewPlan initializes and returns a plan with the given gateways

type Roaster

type Roaster struct {
	*handlers.BaseHandler
	Roaster *helpers.Roaster
}

Roaster implements RoasterI

func (*Roaster) Deactivate

func (c *Roaster) Deactivate(ctx *gin.Context)

Deactivate is not implemented

func (*Roaster) New

func (c *Roaster) New(ctx *gin.Context)

New implements RoasterI.New

func (*Roaster) Update

func (c *Roaster) Update(ctx *gin.Context)

Update is not implemented

func (*Roaster) View

func (c *Roaster) View(ctx *gin.Context)

View implements RoasterI.View

type RoasterI

type RoasterI interface {
	/*New creates a new roaster billing account, sending the result*/
	New(ctx *gin.Context)
	/*View sends the roaster account with the given ID*/
	View(ctx *gin.Context)
	/*Update sets the propperties of a roaster account, sending the update*/
	Update(ctx *gin.Context)
	/*Deactivate removes a roaster account from coinage*/
	Deactivate(ctx *gin.Context)
	/*Time tracks the duration of each handled request*/
	Time() gin.HandlerFunc
	/*GetJWT checks the JWT of a request*/
	GetJWT() gin.HandlerFunc
}

RoasterI describes the roaster requests that Coinage can handle

func NewRoaster

func NewRoaster(ctx *handlers.GatewayContext) RoasterI

NewRoaster returns a new roaster with the given gateways

Jump to

Keyboard shortcuts

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