ifaces

package
v0.0.0-...-3912389 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Name() string
	Routes() Route
	Validate() error
}

type AppListener

type AppListener interface {
	// BeforeAppUpdate called right before storing App in the database
	BeforeAppUpdate(ctx context.Context, app *models.App) error
	// AfterAppUpdate called after storing App in the database
	AfterAppUpdate(ctx context.Context, app *models.App) error
}

type HandlerContext

type HandlerContext interface {
	// Request returns the underlying http.Request object
	Request() *http.Request

	// Datastore returns the models.Datastore object. Not that this has arbitrary key value store methods that can be used to store extra data
	Datastore() models.Datastore

	// Set and Get values on the context, this can be useful to change behavior for the rest of the request
	Set(key string, value interface{})
	Get(key string) (value interface{}, exists bool)
}

Each handler can modify the context here so when it gets passed along, it will use the new info. Not using Gin's Context so we don't lock ourselves into Gin, this is a subset of the Gin context.

type Route

type Route interface {
	Path() string
	Image() string
	Headers() http.Header
}

type SpecialHandler

type SpecialHandler interface {
	Handle(c HandlerContext) error
}

Jump to

Keyboard shortcuts

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