web

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleHook

func HandleHook(
	repos core.RepositoryStore,
	builds core.BuildStore,
	triggerer core.Triggerer,
	parser core.HookParser,
) http.HandlerFunc

HandleHook returns an http.HandlerFunc that handles webhooks triggered by source code management.

func HandleIndex

func HandleIndex(host string, session core.Session, license core.LicenseService) http.HandlerFunc

func HandleLogin

func HandleLogin(
	users core.UserStore,
	userz core.UserService,
	syncer core.Syncer,
	session core.Session,
	admission core.AdmissionService,
	sender core.WebhookSender,
) http.HandlerFunc

HandleLogin creates and http.HandlerFunc that handles user authentication and session initialization.

func HandleLoginForm

func HandleLoginForm() http.HandlerFunc

HandleLoginForm creates and http.HandlerFunc that presents the user with an Login form for password-based authentication.

func HandleLogout

func HandleLogout() http.HandlerFunc

HandleLogout creates an http.HandlerFunc that handles session termination.

func HandleVarz

func HandleVarz(client *scm.Client, license *core.License) http.HandlerFunc

HandleVarz creates an http.HandlerFunc that exposes internal system information.

func HandleVersion

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

HandleVersion creates an http.HandlerFunc that returns the version number and build details.

Types

type Error

type Error struct {
	Message string `json:"message"`
}

Error represents a json-encoded API error.

type Server

type Server struct {
	Admitter  core.AdmissionService
	Builds    core.BuildStore
	Client    *scm.Client
	Hooks     core.HookParser
	License   *core.License
	Licenses  core.LicenseService
	Linker    core.Linker
	Login     login.Middleware
	Repos     core.RepositoryStore
	Session   core.Session
	Syncer    core.Syncer
	Triggerer core.Triggerer
	Users     core.UserStore
	Userz     core.UserService
	Webhook   core.WebhookSender
	Options   secure.Options
	Host      string
}

Server is a http.Handler which exposes drone functionality over HTTP.

func New

func New(
	admitter core.AdmissionService,
	builds core.BuildStore,
	client *scm.Client,
	hooks core.HookParser,
	license *core.License,
	licenses core.LicenseService,
	linker core.Linker,
	login login.Middleware,
	repos core.RepositoryStore,
	session core.Session,
	syncer core.Syncer,
	triggerer core.Triggerer,
	users core.UserStore,
	userz core.UserService,
	webhook core.WebhookSender,
	options secure.Options,
	system *core.System,
) Server

func (Server) Handler

func (s Server) Handler() http.Handler

Handler returns an http.Handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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