handler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeactivateRepo

func DeactivateRepo(c web.C, w http.ResponseWriter, r *http.Request)

DeactivateRepo accepts a request to deactivate the named repository. This will disable all builds in the system for this repository.

POST /api/repos/:host/:owner/:name/deactivate

func DelRepo

func DelRepo(c web.C, w http.ResponseWriter, r *http.Request)

DelRepo accepts a request to delete the named repository.

DEL /api/repos/:host/:owner/:name

func DelUser

func DelUser(c web.C, w http.ResponseWriter, r *http.Request)

DeleteUser accepts a request to delete the specified user account from the system. A successful request will respond with an OK 200 status.

DELETE /api/users/:host/:login

func DelWorker

func DelWorker(c web.C, w http.ResponseWriter, r *http.Request)

Delete accepts a request to delete a worker from the pool.

DELETE /api/workers

func GetBadge

func GetBadge(c web.C, w http.ResponseWriter, r *http.Request)

GetBadge accepts a request to retrieve the named repo and branhes latest build details from the datastore and return an SVG badges representing the build results.

GET /api/badge/:host/:owner/:name/status.svg

func GetCC

func GetCC(c web.C, w http.ResponseWriter, r *http.Request)

GetCC accepts a request to retrieve the latest build status for the given repository from the datastore and in CCTray XML format.

GET /api/badge/:host/:owner/:name/cc.xml

func GetCommit

func GetCommit(c web.C, w http.ResponseWriter, r *http.Request)

GetCommit accepts a request to retrieve a commit from the datastore for the given repository, branch and commit hash.

GET /api/repos/:host/:owner/:name/branches/:branch/commits/:commit

func GetCommitList

func GetCommitList(c web.C, w http.ResponseWriter, r *http.Request)

GetCommitList accepts a request to retrieve a list of recent commits by Repo, and retur in JSON format.

GET /api/repos/:host/:owner/:name/commits?limit=:limit&offset=:offset

func GetLogin

func GetLogin(c web.C, w http.ResponseWriter, r *http.Request)

GetLogin accepts a request to authorize the user and to return a valid OAuth2 access token. The access token is returned as url segment #access_token

GET /login/:host

func GetLoginList

func GetLoginList(c web.C, w http.ResponseWriter, r *http.Request)

GetLoginList accepts a request to retrive a list of all OAuth login options.

GET /api/remotes/login

func GetOutput

func GetOutput(c web.C, w http.ResponseWriter, r *http.Request)

GetOutput gets the commit's stdout.

GET /api/repos/:host/:owner/:name/branches/:branch/commits/:commit/console

func GetRepo

func GetRepo(c web.C, w http.ResponseWriter, r *http.Request)

GetRepo accepts a request to retrieve a commit from the datastore for the given repository, branch and commit hash.

GET /api/repos/:host/:owner/:name

func GetUser

func GetUser(c web.C, w http.ResponseWriter, r *http.Request)

GetUser accepts a request to retrieve a user by hostname and login from the datastore and return encoded in JSON format.

GET /api/users/:host/:login

func GetUserActivity

func GetUserActivity(c web.C, w http.ResponseWriter, r *http.Request)

GetUserActivity accepts a request to get the user's latest build activity, across all repositories, from the datastore. The results are encoded and returned in JSON format.

GET /api/user/activity?limit=:limit&offset=:offset

func GetUserCurrent

func GetUserCurrent(c web.C, w http.ResponseWriter, r *http.Request)

GetUserCurrent accepts a request to retrieve the currently authenticated user from the datastore and return in JSON format.

GET /api/user

func GetUserFeed

func GetUserFeed(c web.C, w http.ResponseWriter, r *http.Request)

GetUserFeed accepts a request to get the user's latest build feed, across all repositories, from the datastore. The results are encoded and returned in JSON format.

GET /api/user/feed

func GetUserList

func GetUserList(c web.C, w http.ResponseWriter, r *http.Request)

GetUsers accepts a request to retrieve all users from the datastore and return encoded in JSON format.

GET /api/users

func GetUserRepos

func GetUserRepos(c web.C, w http.ResponseWriter, r *http.Request)

GetRepos accepts a request to get the currently authenticated user's repository list from the datastore, encoded and returned in JSON format.

GET /api/user/repos

func GetWorkAssigned

func GetWorkAssigned(c web.C, w http.ResponseWriter, r *http.Request)

GetWorkAssigned accepts a request to retrieve the list of started work and returns in JSON format.

GET /api/work/assignments

func GetWorkPending

func GetWorkPending(c web.C, w http.ResponseWriter, r *http.Request)

GetWorkPending accepts a request to retrieve the list of pending work and returns in JSON format.

GET /api/work/pending

func GetWorkStarted

func GetWorkStarted(c web.C, w http.ResponseWriter, r *http.Request)

GetWorkStarted accepts a request to retrieve the list of started work and returns in JSON format.

GET /api/work/started

func GetWorkers

func GetWorkers(c web.C, w http.ResponseWriter, r *http.Request)

GetWorkers accepts a request to retrieve the list of registered workers and return the results in JSON format.

GET /api/workers

func PostCommit

func PostCommit(c web.C, w http.ResponseWriter, r *http.Request)

PostHook accepts a post-commit hook and parses the payload in order to trigger a build. The payload is specified to the remote system (ie GitHub) and will therefore get parsed by the appropriate remote plugin.

POST /api/repos/{host}/{owner}/{name}/branches/{branch}/commits/{commit}

func PostHook

func PostHook(c web.C, w http.ResponseWriter, r *http.Request)

PostHook accepts a post-commit hook and parses the payload in order to trigger a build. The payload is specified to the remote system (ie GitHub) and will therefore get parsed by the appropriate remote plugin.

GET /api/hook/:host

func PostRepo

func PostRepo(c web.C, w http.ResponseWriter, r *http.Request)

PostRepo accapets a request to activate the named repository in the datastore. It returns a 201 status created if successful

POST /api/repos/:host/:owner/:name

func PostUser

func PostUser(c web.C, w http.ResponseWriter, r *http.Request)

PostUser accepts a request to create a new user in the system. The created user account is returned in JSON format if successful.

POST /api/users/:host/:login

func PostUserSync

func PostUserSync(c web.C, w http.ResponseWriter, r *http.Request)

PostUserSync accepts a request to post user sync

POST /api/user/sync

func PostWorker

func PostWorker(c web.C, w http.ResponseWriter, r *http.Request)

PostWorker accepts a request to allocate a new worker to the pool.

POST /api/workers

func PutRepo

func PutRepo(c web.C, w http.ResponseWriter, r *http.Request)

PutRepo accapets a request to update the named repository in the datastore. It expects a JSON input and returns the updated repository in JSON format if successful.

PUT /api/repos/:host/:owner/:name

func PutUser

func PutUser(c web.C, w http.ResponseWriter, r *http.Request)

PutUser accepts a request to update the currently authenticated User profile.

PUT /api/user

func ToLimit

func ToLimit(r *http.Request) int

ToLimit returns the Limit from current request query if limit doesn't present set default offset equal to 20, maximum limit equal 100

func ToOffset

func ToOffset(r *http.Request) int

ToOffset returns the Offset from current request query if offset doesn't present set default offset equal to 0

func ToRepo

func ToRepo(c web.C) *model.Repo

ToRepo returns the Repo from the current request context. If the Repo does not exist a nil value is returned.

func ToRole

func ToRole(c web.C) *model.Perm

ToRole returns the Role from the current request context. If the Role does not exist a nil value is returned.

func ToUser

func ToUser(c web.C) *model.User

ToUser returns the User from the current request context. If the User does not exist a nil value is returned.

func WsConsole

func WsConsole(c web.C, w http.ResponseWriter, r *http.Request)

WsConsole will upgrade the connection to a Websocket and will stream the build output to the browser.

func WsUser

func WsUser(c web.C, w http.ResponseWriter, r *http.Request)

WsUser will upgrade the connection to a Websocket and will stream all events to the browser pertinent to the authenticated user. If the user is not authenticated, only public events are streamed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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