handler

package
Version: v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2014 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminSettings

func AdminSettings(w http.ResponseWriter, r *http.Request, u *User) error

Return an HTML form for the User to update the site settings.

func AdminSettingsUpdate

func AdminSettingsUpdate(w http.ResponseWriter, r *http.Request, u *User) error

func AdminUserAdd

func AdminUserAdd(w http.ResponseWriter, r *http.Request, u *User) error

Invite a user to join the system

func AdminUserDelete

func AdminUserDelete(w http.ResponseWriter, r *http.Request, u *User) error

func AdminUserEdit

func AdminUserEdit(w http.ResponseWriter, r *http.Request, u *User) error

Form to edit a user

func AdminUserInvite

func AdminUserInvite(w http.ResponseWriter, r *http.Request, u *User) error

Invite a user to join the system

func AdminUserList

func AdminUserList(w http.ResponseWriter, r *http.Request, u *User) error

Display a list of ALL users in the system

func AdminUserUpdate

func AdminUserUpdate(w http.ResponseWriter, r *http.Request, u *User) error

func Authorize

func Authorize(w http.ResponseWriter, r *http.Request) error

Create the User session.

func Badge

func Badge(w http.ResponseWriter, r *http.Request) error

Display a static badge (svg format) for a specific repository and an optional branch. TODO this needs to implement basic caching

func BuildOut

func BuildOut(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

Returns the combined stdout / stderr for an individual Build.

func BuildOutGzip

func BuildOutGzip(w http.ResponseWriter, r *http.Request, u *User) error

Returns the gzipped stdout / stderr for an individual Build

func BuildStatus added in v0.2.1

func BuildStatus(w http.ResponseWriter, r *http.Request, repo *Repo) error

Returns the combined stdout / stderr for an individual Build.

func CommitShow

func CommitShow(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

Display a specific Commit.

func DelCookie

func DelCookie(w http.ResponseWriter, r *http.Request, name string)

DelCookie deletes a secure cookie.

func Forgot

func Forgot(w http.ResponseWriter, r *http.Request) error

Return an HTML form for the User to request a password reset.

func ForgotPost

func ForgotPost(w http.ResponseWriter, r *http.Request) error

func GetCookie

func GetCookie(r *http.Request, name string) string

GetCookie retrieves and verifies the signed cookie value.

func Index

func Index(w http.ResponseWriter, r *http.Request) error

Returns an HTML index.html page if the user is not currently authenticated, otherwise redirects the user to their personal dashboard screen

func Install

func Install(w http.ResponseWriter, r *http.Request) error

func InstallPost

func InstallPost(w http.ResponseWriter, r *http.Request) error

func IsHttps

func IsHttps(r *http.Request) bool

func LinkBitbucket added in v0.2.1

func LinkBitbucket(w http.ResponseWriter, r *http.Request, u *User) error

func LinkGithub

func LinkGithub(w http.ResponseWriter, r *http.Request, u *User) error

func Login

func Login(w http.ResponseWriter, r *http.Request) error

Return an HTML form for the User to login.

func Logout

func Logout(w http.ResponseWriter, r *http.Request) error

Terminate the User session.

func Register

func Register(w http.ResponseWriter, r *http.Request) error

Return an HTML form to register for a new account. This page must be visited from a Signup email that contains a hash to verify the Email address is correct.

func RegisterPost

func RegisterPost(w http.ResponseWriter, r *http.Request) error

func RenderError

func RenderError(w http.ResponseWriter, err error, code int) error

RenderError renders a text representation of the Error message.

func RenderForbidden

func RenderForbidden(w http.ResponseWriter) error

Renders the 403 template for the specified data type and write the output to the http.ResponseWriter.

func RenderJson

func RenderJson(w http.ResponseWriter, data interface{}) error

RenderJson renders a JSON representation of resource v and writes to the http.ResposneWriter.

func RenderNotFound

func RenderNotFound(w http.ResponseWriter) error

Renders the 404 template for the specified data type and write the output to the http.ResponseWriter.

func RenderTemplate

func RenderTemplate(w http.ResponseWriter, name string, data interface{}) error

Renders the named template for the specified data type and write the output to the http.ResponseWriter.

func RenderText

func RenderText(w http.ResponseWriter, text string, code int) error

RenderText write the plain text string to the http.ResposneWriter.

func RepoAddBitbucket added in v0.2.1

func RepoAddBitbucket(w http.ResponseWriter, r *http.Request, u *User) error

func RepoAddGithub added in v0.2.1

func RepoAddGithub(w http.ResponseWriter, r *http.Request, u *User) error

func RepoBadges

func RepoBadges(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

func RepoCreateBitbucket added in v0.2.1

func RepoCreateBitbucket(w http.ResponseWriter, r *http.Request, u *User) error

func RepoCreateGithub

func RepoCreateGithub(w http.ResponseWriter, r *http.Request, u *User) error

func RepoDashboard

func RepoDashboard(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

Display a Repository dashboard.

func RepoDelete

func RepoDelete(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

Deletes a specific repository.

func RepoDeleteForm

func RepoDeleteForm(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

Deletes a specific repository.

func RepoKeys

func RepoKeys(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

func RepoParamsForm

func RepoParamsForm(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

Repository Params (YAML parameters) Form

func RepoSettingsForm

func RepoSettingsForm(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

Repository Settings

func RepoUpdate

func RepoUpdate(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

Updates an existing repository.

func Reset

func Reset(w http.ResponseWriter, r *http.Request) error

Return an HTML form for the User to perform a password reset. This page must be visited from a Password Reset email that contains a hash to verify the User's identity.

func ResetPost

func ResetPost(w http.ResponseWriter, r *http.Request) error

func SetCookie

func SetCookie(w http.ResponseWriter, r *http.Request, name, value string)

SetCookie signs and writes the cookie value.

func SignUp

func SignUp(w http.ResponseWriter, r *http.Request) error

Return an HTML form for the User to signup.

func SignUpPost

func SignUpPost(w http.ResponseWriter, r *http.Request) error

func TeamAdd

func TeamAdd(w http.ResponseWriter, r *http.Request, u *User) error

Return an HTML form for creating a Team.

func TeamCreate

func TeamCreate(w http.ResponseWriter, r *http.Request, u *User) error

Create a new Team.

func TeamDelete

func TeamDelete(w http.ResponseWriter, r *http.Request, u *User) error

Delete a specific Team.

func TeamDeleteConfirm

func TeamDeleteConfirm(w http.ResponseWriter, r *http.Request, u *User) error

Delete Confirmation Page

func TeamEdit

func TeamEdit(w http.ResponseWriter, r *http.Request, u *User) error

Return an HTML form for editing a Team.

func TeamMemberAccept

func TeamMemberAccept(w http.ResponseWriter, r *http.Request, u *User) error

func TeamMemberAdd

func TeamMemberAdd(w http.ResponseWriter, r *http.Request, u *User) error

Return an HTML form for creating a new Team Member.

func TeamMemberDelete

func TeamMemberDelete(w http.ResponseWriter, r *http.Request, u *User) error

Delete a specific Team Member.

func TeamMemberEdit

func TeamMemberEdit(w http.ResponseWriter, r *http.Request, u *User) error

Return an HTML form for editing a Team Member.

func TeamMemberInvite

func TeamMemberInvite(w http.ResponseWriter, r *http.Request, u *User) error

Invite a new Team Member.

func TeamMemberUpdate

func TeamMemberUpdate(w http.ResponseWriter, r *http.Request, u *User) error

Update a specific Team Member.

func TeamMembers

func TeamMembers(w http.ResponseWriter, r *http.Request, u *User) error

Display a list of Team Members.

func TeamShow

func TeamShow(w http.ResponseWriter, r *http.Request, u *User) error

Display a specific Team.

func TeamUpdate

func TeamUpdate(w http.ResponseWriter, r *http.Request, u *User) error

Update a specific Team.

func UserDelete

func UserDelete(w http.ResponseWriter, r *http.Request, u *User) error

delete a specific user.

func UserDeleteConfirm

func UserDeleteConfirm(w http.ResponseWriter, r *http.Request, u *User) error

return an HTML form for deleting a user.

func UserEdit

func UserEdit(w http.ResponseWriter, r *http.Request, u *User) error

return an HTML form for editing a user

func UserInvite

func UserInvite(w http.ResponseWriter, r *http.Request) error

func UserPass

func UserPass(w http.ResponseWriter, r *http.Request, u *User) error

return an HTML form for editing a user password

func UserPassUpdate

func UserPassUpdate(w http.ResponseWriter, r *http.Request, u *User) error

update a specific user's password

func UserShow

func UserShow(w http.ResponseWriter, r *http.Request, u *User) error

Display the dashboard for a specific user

func UserTeams

func UserTeams(w http.ResponseWriter, r *http.Request, u *User) error

Display a list of all Teams for the currently authenticated User.

func UserUpdate

func UserUpdate(w http.ResponseWriter, r *http.Request, u *User) error

update a specific user

Types

type AdminHandler

type AdminHandler func(w http.ResponseWriter, r *http.Request, user *User) error

AdminHandler wraps the default http.HandlerFunc to include the currently authenticated User in the method signature, in addition to handling an error as the return value. It also verifies the user has Administrative privileges.

func (AdminHandler) ServeHTTP

func (h AdminHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type BitbucketHandler added in v0.2.1

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

func NewBitbucketHandler added in v0.2.1

func NewBitbucketHandler(queue *queue.Queue) *BitbucketHandler

func (*BitbucketHandler) Hook added in v0.2.1

Processes a generic POST-RECEIVE Bitbucket hook and attempts to trigger a build.

type BuildResult added in v0.2.1

type BuildResult struct {
	Status string
}

type CommitRebuildHandler added in v0.2.1

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

func NewCommitRebuildHandler added in v0.2.1

func NewCommitRebuildHandler(queue *queue.Queue) *CommitRebuildHandler

func (*CommitRebuildHandler) CommitRebuild added in v0.2.1

func (h *CommitRebuildHandler) CommitRebuild(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error

CommitRebuild re-queues a previously built commit. It finds the existing commit and build and injects them back into the queue. If the commit doesn't exist or has no builds, or if a build label has been passed but can't be located, it prints an error. Otherwise, it adds the build/commit to the queue and redirects back to the commit page.

type ErrorHandler

type ErrorHandler func(w http.ResponseWriter, r *http.Request) error

ErrorHandler wraps the default http.HandleFunc to handle an error as the return value.

func (ErrorHandler) ServeHTTP

func (h ErrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GithubHandler added in v0.2.1

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

func NewGithubHandler added in v0.2.1

func NewGithubHandler(queue *queue.Queue) *GithubHandler

func (*GithubHandler) Hook added in v0.2.1

Processes a generic POST-RECEIVE GitHub hook and attempts to trigger a build.

func (*GithubHandler) PullRequestHook added in v0.2.1

func (h *GithubHandler) PullRequestHook(w http.ResponseWriter, r *http.Request)

type GitlabHandler added in v0.2.1

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

func NewGitlabHandler added in v0.2.1

func NewGitlabHandler(queue *queue.Queue) *GitlabHandler

func (*GitlabHandler) Add added in v0.2.1

func (g *GitlabHandler) Add(w http.ResponseWriter, r *http.Request, u *User) error

func (*GitlabHandler) Create added in v0.2.1

func (g *GitlabHandler) Create(w http.ResponseWriter, r *http.Request, u *User) error

func (*GitlabHandler) Hook added in v0.2.1

func (g *GitlabHandler) Link(w http.ResponseWriter, r *http.Request, u *User) error

func (*GitlabHandler) PullRequestHook added in v0.2.1

func (g *GitlabHandler) PullRequestHook(p *gogitlab.HookPayload, repo *Repo, user *User) error
func (g *GitlabHandler) ReLink(w http.ResponseWriter, r *http.Request, u *User) error

type PublicHandler added in v0.2.1

type PublicHandler func(w http.ResponseWriter, r *http.Request, repo *Repo) error

PublicHandler wraps the default http.HandlerFunc to include requested Repository in the method signature, in addition to handling an error as the return value.

func (PublicHandler) ServeHTTP added in v0.2.1

func (h PublicHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RepoAdminHandler

type RepoAdminHandler func(w http.ResponseWriter, r *http.Request, user *User, repo *Repo) error

RepoHandler wraps the default http.HandlerFunc to include the currently authenticated User and requested Repository in the method signature, in addition to handling an error as the return value.

func (RepoAdminHandler) ServeHTTP

func (h RepoAdminHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RepoHandler

type RepoHandler func(w http.ResponseWriter, r *http.Request, user *User, repo *Repo) error

func (RepoHandler) ServeHTTP

func (h RepoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UserHandler

type UserHandler func(w http.ResponseWriter, r *http.Request, user *User) error

UserHandler wraps the default http.HandlerFunc to include the currently authenticated User in the method signature, in addition to handling an error as the return value.

func (UserHandler) ServeHTTP

func (h UserHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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