route

package
v0.0.0-...-366f0b0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: Apache-2.0 Imports: 39 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, opts HandlerOpts)

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 NewCommitQueueItemOwnerMiddleware

func NewCommitQueueItemOwnerMiddleware(sc data.Connector) gimlet.Middleware

func NewProjectAdminMiddleware

func NewProjectAdminMiddleware(sc data.Connector) gimlet.Middleware

func NewProjectContextMiddleware

func NewProjectContextMiddleware(sc data.Connector) gimlet.Middleware

func NewTaskAuthMiddleware

func NewTaskAuthMiddleware(sc data.Connector) gimlet.Middleware

Types

type CommitQueueItemOwnerMiddleware

type CommitQueueItemOwnerMiddleware struct {
	// contains filtered or unexported fields
}

func (*CommitQueueItemOwnerMiddleware) ServeHTTP

type HandlerOpts

type HandlerOpts struct {
	APIQueue     amboy.Queue
	QueueGroup   amboy.QueueGroup
	URL          string
	SuperUsers   []string
	GithubSecret []byte
}

type TaskAuthMiddleware

type TaskAuthMiddleware struct {
	// contains filtered or unexported fields
}

func (*TaskAuthMiddleware) ServeHTTP

func (m *TaskAuthMiddleware) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

Jump to

Keyboard shortcuts

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