application

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: BSD-3-Clause Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FaviconHandler added in v0.2.0

func FaviconHandler(w http.ResponseWriter, r *http.Request)

func MagicPathHandler

func MagicPathHandler(next http.Handler) http.Handler

func RobotsHandler added in v0.2.0

func RobotsHandler(w http.ResponseWriter, r *http.Request)

Types

type Application

type Application struct {
	Services map[string]service.Service

	Domain    string
	GitlabURL string
	Router    http.Handler
	// contains filtered or unexported fields
}

func New

func New(cfg *conf.Conf) (*Application, error)

func (*Application) BadgeMyTaskHandler

func (a *Application) BadgeMyTaskHandler(latest bool) http.HandlerFunc

BadgeMyTaskHandler generates a badge for a given task

func (*Application) HomeHandler

func (a *Application) HomeHandler() http.HandlerFunc

HomeHandler display the home page

func (*Application) ListServices added in v0.2.0

func (a *Application) ListServices() []string

ListServices returns a list of all services as string array

func (*Application) PostTaskHandler

func (a *Application) PostTaskHandler(w http.ResponseWriter, r *http.Request)

PostTaskHandler create a Task

func (*Application) ReadmeHandler

func (a *Application) ReadmeHandler(w http.ResponseWriter, r *http.Request)

func (*Application) RefererMiddleware added in v0.2.0

func (a *Application) RefererMiddleware(next http.Handler) http.Handler

RefererMiddleware ensure that requests comes from the gitlab domain

func (*Application) ServiceMiddleware

func (a *Application) ServiceMiddleware(next http.Handler) http.Handler

Http middleware

func (*Application) ServicesHandler

func (a *Application) ServicesHandler(w http.ResponseWriter, r *http.Request)

ServicesHandler show all services

func (*Application) TaskHandler

func (a *Application) TaskHandler(latest bool) http.HandlerFunc

TaskHandler show a Task

func (*Application) TaskIDHandler

func (a *Application) TaskIDHandler(w http.ResponseWriter, r *http.Request)

TaskIDHandler get a task using it's ID

func (*Application) VolumesHandler

func (a *Application) VolumesHandler(basePathLen int, latest bool) http.HandlerFunc

VolumesHandler expose volumes of a task

type Result added in v0.2.0

type Result struct {
	GitlabDomain string
	Domain       string
	Project      string
	Commit       string
	Service      string
	ID           string
	CreatedAt    string
	Inner        template.HTML
}

Result of a task for html rendering

func NewResultFromTask added in v0.2.0

func NewResultFromTask(t *task.Task, inner template.HTML, gitlabDomain string) (*Result, error)

NewResultFromTask inits a result for a task

Jump to

Keyboard shortcuts

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