route

package
v0.0.0-...-a9abf63 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// GroupBy API values for tasks
	StatsAPITaskGroupByDistro  = "task_variant_distro"
	StatsAPITaskGroupByVariant = "task_variant"
	StatsAPITaskGroupByTask    = "task"
)
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 CheckUnexpirableHostLimitExceeded

func CheckUnexpirableHostLimitExceeded(userId string, maxHosts int) error

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

func NewTaskHostAuthMiddleware

func NewTaskHostAuthMiddleware(sc data.Connector) gimlet.Middleware

func RequiresDistroPermission

func RequiresDistroPermission(permission string, level evergreen.PermissionLevel) gimlet.Middleware

func RequiresProjectPermission

func RequiresProjectPermission(permission string, level evergreen.PermissionLevel) gimlet.Middleware

func RequiresSuperUserPermission

func RequiresSuperUserPermission(permission string, level evergreen.PermissionLevel) gimlet.Middleware

Types

type CommitQueueItemOwnerMiddleware

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

func (*CommitQueueItemOwnerMiddleware) ServeHTTP

type EventLogPermissionsMiddleware

type EventLogPermissionsMiddleware struct{}

func (*EventLogPermissionsMiddleware) ServeHTTP

type HandlerOpts

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

type RequestedPermissions

type RequestedPermissions struct {
	ResourceType string             `json:"resource_type"`
	Resources    []string           `json:"resources"`
	Permissions  gimlet.Permissions `json:"permissions"`
}

type StatsHandler

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

func (*StatsHandler) ParseCommonFilter

func (sh *StatsHandler) ParseCommonFilter(vals url.Values) error

ParseCommonFilter parses the query parameter values and fills the struct filter field.

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)

type TaskHostAuthMiddleware

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

func (*TaskHostAuthMiddleware) ServeHTTP

Jump to

Keyboard shortcuts

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