Help us shape the future of Go! Take the 2026 Go Developer Survey

application

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: BSD-3-Clause Imports: 54 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminHomeHandler added in v0.2.2

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

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
	AdminRouter http.Handler

	Sink        *events.Broadcaster
	Server      *http.Server
	AdminServer *http.Server
	Stopper     chan (os.Signal)
	// contains filtered or unexported fields
}

func New

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

func (*Application) AdminRun added in v0.2.2

func (a *Application) AdminRun(listen string) 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) PostImageHandler added in v0.3.0

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

PostImageHandler is used to pull the request image, see https://docs.docker.com/engine/api/sdk/examples/#pull-an-image-with-authentication

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) Run added in v0.2.2

func (a *Application) Run(listen string) error

Run make the app listen and serve requests

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) Shutdown added in v0.2.2

func (a *Application) Shutdown() error

Shutdown the server and put running tasks into interrupted state

func (*Application) SinkAllHandler added in v0.3.0

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

SinkAllHandler show 5 minutes of Task events

func (*Application) SinkHandler added in v0.3.0

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

SinkHandler show the events of a specific run and stop

func (*Application) StatusHandler added in v0.2.4

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

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) TaskLogsHandler added in v0.2.2

func (a *Application) TaskLogsHandler(latest bool) func(http.ResponseWriter, *http.Request)

TaskLogsHandler get a logs for a task, used to get row logs from curl, not used for now

func (*Application) TaskLogzHandler added in v0.2.2

func (a *Application) TaskLogzHandler(latest bool) func(http.ResponseWriter, *http.Request)

TaskLogzHandler get a logs for a task

func (*Application) VolumesHandler

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

VolumesHandler expose volumes of a task

type HttpSink added in v0.3.0

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

func NewHttpSink added in v0.3.0

func NewHttpSink(r *http.Request, w http.ResponseWriter, waitForEnd bool) (*HttpSink, error)

func (*HttpSink) Close added in v0.3.0

func (h *HttpSink) Close() error

func (*HttpSink) Wait added in v0.3.0

func (h *HttpSink) Wait()

func (*HttpSink) Write added in v0.3.0

func (h *HttpSink) Write(event events.Event) error

type ImageParams added in v0.3.0

type ImageParams struct {
	Name      string `json:"name"`
	AuthToken string `json:"auth_token"`
}

ImageParams describe body data

type Status added in v0.2.4

type Status struct {
	Ping    types.Ping    `json:"docker"`
	Gitlab  *gitlabStatus `json:"gitlab"`
	Version string        `json:"version"`
}

type TaskMatcher added in v0.3.0

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

func (*TaskMatcher) Match added in v0.3.0

func (t *TaskMatcher) Match(event events.Event) bool

type TaskPage added in v0.2.2

type TaskPage struct {
	GitlabDomain    string
	Domain          string
	Project         string
	Commit          string
	Service         string
	Branch          string
	ID              string
	CreatedAt       string
	InnerDivClasses string
	InnerTitle      string
	Inner           template.HTML
}

TaskPage present a page and an associated inner content

func NewTaskPage added in v0.2.2

func NewTaskPage(t *task.Task, inner template.HTML, gitlabDomain, InnerTitle, InnerDivClasses string) (*TaskPage, error)

NewTaskPage inits a result for a task

Jump to

Keyboard shortcuts

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