route

package
v0.0.0-...-0bb0e66 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Key value used to map user and project data to request context.
	// These are private custom types to avoid key collisions.
	RequestContext requestContextKey = 0
)

Variables

This section is empty.

Functions

func AttachHandler

func AttachHandler(app *gimlet.APIApp, queue amboy.Queue, URL string, superUsers []string, githubSecret []byte)

AttachHandler attaches the api's request handlers to the given mux router. It builds a Connector then attaches each of the main functions for the api to the router.

func GetProjectContext

func GetProjectContext(ctx context.Context) *model.Context

GetProjectContext returns the project context associated with a given request.

func MustHaveProjectContext

func MustHaveProjectContext(ctx context.Context) *model.Context

MustHaveProjectContext returns the project context set on the http request context. It panics if none is set.

func MustHaveUser

func MustHaveUser(ctx context.Context) *user.DBUser

MustHaveUser returns the user associated with a given request or panics if none is present.

func NewProjectContextMiddleware

func NewProjectContextMiddleware(sc data.Connector) gimlet.Middleware

Types

This section is empty.

Jump to

Keyboard shortcuts

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