Documentation
¶
Index ¶
- Constants
- func AttachHandler(app *gimlet.APIApp, opts HandlerOpts)
- func GetProjectContext(ctx context.Context) *model.Context
- func MustHaveProjectContext(ctx context.Context) *model.Context
- func MustHaveUser(ctx context.Context) *user.DBUser
- func NewCommitQueueItemOwnerMiddleware(sc data.Connector) gimlet.Middleware
- func NewProjectAdminMiddleware(sc data.Connector) gimlet.Middleware
- func NewProjectContextMiddleware(sc data.Connector) gimlet.Middleware
- func NewTaskAuthMiddleware(sc data.Connector) gimlet.Middleware
- type CommitQueueItemOwnerMiddleware
- type HandlerOpts
- type StatsHandler
- type TaskAuthMiddleware
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 GetProjectContext ¶
GetProjectContext returns the project context associated with a given request.
func MustHaveProjectContext ¶
MustHaveProjectContext returns the project context set on the http request context. It panics if none is set.
func MustHaveUser ¶
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 ¶
func (m *CommitQueueItemOwnerMiddleware) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type HandlerOpts ¶
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)
Source Files
¶
- admin_banner.go
- admin_clear.go
- admin_events.go
- admin_flags.go
- admin_legacy.go
- admin_restart.go
- admin_settings.go
- alias.go
- build.go
- build_task.go
- cli_version.go
- commit_queue.go
- cost.go
- distro.go
- github.go
- host.go
- host_create.go
- host_spawn.go
- keys.go
- middleware.go
- notification.go
- notifications_route.go
- patch.go
- placeholder.go
- project.go
- project_copy.go
- project_events.go
- reliability.go
- service.go
- stats.go
- status.go
- subscription.go
- task.go
- task_abort.go
- task_generate.go
- task_manifest.go
- task_project.go
- task_restart.go
- test.go
- user.go
- version.go
- version_create.go
Click to show internal directories.
Click to hide internal directories.