Documentation
¶
Overview ¶
Package api provides the handlers for the Vela API.
Usage:
import "github.com/go-vela/server/api"
Index ¶
- func Authenticate(c *gin.Context)
- func AuthenticateToken(c *gin.Context)
- func AuthenticateType(c *gin.Context)
- func BaseMetrics() http.Handler
- func CancelBuild(c *gin.Context)
- func ChownRepo(c *gin.Context)
- func CompilePipeline(c *gin.Context)
- func CreateBuild(c *gin.Context)
- func CreateDeployment(c *gin.Context)
- func CreateHook(c *gin.Context)
- func CreateRepo(c *gin.Context)
- func CreateSecret(c *gin.Context)
- func CreateService(c *gin.Context)
- func CreateServiceLog(c *gin.Context)
- func CreateStep(c *gin.Context)
- func CreateStepLog(c *gin.Context)
- func CreateToken(c *gin.Context)
- func CreateUser(c *gin.Context)
- func CreateWorker(c *gin.Context)
- func CustomMetrics(c *gin.Context)
- func DeleteBuild(c *gin.Context)
- func DeleteHook(c *gin.Context)
- func DeleteRepo(c *gin.Context)
- func DeleteSecret(c *gin.Context)
- func DeleteService(c *gin.Context)
- func DeleteServiceLog(c *gin.Context)
- func DeleteStep(c *gin.Context)
- func DeleteStepLog(c *gin.Context)
- func DeleteToken(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func DeleteWorker(c *gin.Context)
- func ExpandPipeline(c *gin.Context)
- func GetBadge(c *gin.Context)
- func GetBuild(c *gin.Context)
- func GetBuildLogs(c *gin.Context)
- func GetBuilds(c *gin.Context)
- func GetCurrentUser(c *gin.Context)
- func GetDeployment(c *gin.Context)
- func GetDeployments(c *gin.Context)
- func GetHook(c *gin.Context)
- func GetHooks(c *gin.Context)
- func GetOrgBuilds(c *gin.Context)
- func GetOrgRepos(c *gin.Context)
- func GetPipeline(c *gin.Context)
- func GetRepo(c *gin.Context)
- func GetRepos(c *gin.Context)
- func GetSecret(c *gin.Context)
- func GetSecrets(c *gin.Context)
- func GetService(c *gin.Context)
- func GetServiceLog(c *gin.Context)
- func GetServices(c *gin.Context)
- func GetStep(c *gin.Context)
- func GetStepLog(c *gin.Context)
- func GetSteps(c *gin.Context)
- func GetTemplates(c *gin.Context)
- func GetUser(c *gin.Context)
- func GetUserSourceRepos(c *gin.Context)
- func GetUsers(c *gin.Context)
- func GetWorker(c *gin.Context)
- func GetWorkers(c *gin.Context)
- func Health(c *gin.Context)
- func Login(c *gin.Context)
- func Logout(c *gin.Context)
- func PostWebhook(c *gin.Context)
- func RefreshAccessToken(c *gin.Context)
- func RepairRepo(c *gin.Context)
- func RestartBuild(c *gin.Context)
- func UpdateBuild(c *gin.Context)
- func UpdateCurrentUser(c *gin.Context)
- func UpdateHook(c *gin.Context)
- func UpdateRepo(c *gin.Context)
- func UpdateSecret(c *gin.Context)
- func UpdateService(c *gin.Context)
- func UpdateServiceLog(c *gin.Context)
- func UpdateStep(c *gin.Context)
- func UpdateStepLog(c *gin.Context)
- func UpdateUser(c *gin.Context)
- func UpdateWorker(c *gin.Context)
- func ValidatePipeline(c *gin.Context)
- func Version(c *gin.Context)
- type HeaderLink
- type Pagination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
Authenticate represents the API handler to process a user logging in to Vela from the API or UI.
nolint: funlen // ignore function length due to comments
func AuthenticateToken ¶ added in v0.7.0
AuthenticateToken represents the API handler to process a user logging in using PAT to Vela from the API.
func AuthenticateType ¶ added in v0.7.0
AuthenticateType handles cases where the OAuth callback was overridden by supplying a redirect_uri in the login process. It will send the user to the destination to handle the last leg in the auth flow - exchanging "code" and "state" for a token. This will only handle non-headless flows (ie. web or cli).
func BaseMetrics ¶
BaseMetrics returns a Prometheus handler for serving go metrics.
func CancelBuild ¶ added in v0.7.0
CancelBuild represents the API handler to cancel a running build.
func ChownRepo ¶
ChownRepo represents the API handler to change the owner of a repo in the configured backend.
func CompilePipeline ¶ added in v0.7.0
CompilePipeline represents the API handler to capture, expand and compile a pipeline configuration.
nolint: funlen // ignore function length due to comments
func CreateBuild ¶
CreateBuild represents the API handler to create a build in the configured backend.
nolint: funlen // ignore function length due to comments
func CreateDeployment ¶ added in v0.4.0
CreateDeployment represents the API handler to create a deployment in the configured backend.
func CreateHook ¶ added in v0.2.0
CreateHook represents the API handler to create a webhook in the configured backend.
func CreateRepo ¶
CreateRepo represents the API handler to create a repo in the configured backend. nolint:funlen,gocyclo // ignore function length and cyclomatic complexity
func CreateSecret ¶
CreateSecret represents the API handler to create a secret in the configured backend.
func CreateService ¶
CreateService represents the API handler to create a service for a build in the configured backend.
nolint: dupl // ignore similar code with step
func CreateServiceLog ¶
CreateServiceLog represents the API handler to create the logs for a service in the configured backend.
nolint: dupl // ignore similar code with step
func CreateStep ¶
CreateStep represents the API handler to create a step for a build in the configured backend.
nolint: dupl // ignore similar code with service
func CreateStepLog ¶
CreateStepLog represents the API handler to create the logs for a step in the configured backend.
nolint: dupl // ignore similar code with service
func CreateToken ¶
CreateToken represents the API handler to create a user token in the configured backend.
func CreateUser ¶
CreateUser represents the API handler to create a user in the configured backend.
func CreateWorker ¶ added in v0.7.0
CreateWorker represents the API handler to create a worker in the configured backend.
func CustomMetrics ¶
CustomMetrics returns custom Prometheus metrics from private functions.
func DeleteBuild ¶
DeleteBuild represents the API handler to remove a build for a repo from the configured backend.
func DeleteHook ¶ added in v0.2.0
DeleteHook represents the API handler to remove a webhook from the configured backend.
func DeleteRepo ¶
DeleteRepo represents the API handler to remove a repo from the configured backend.
func DeleteSecret ¶
DeleteSecret deletes a secret from the provided secrets service.
func DeleteService ¶
DeleteService represents the API handler to remove a service for a build from the configured backend.
nolint: dupl // ignore similar code with step
func DeleteServiceLog ¶
DeleteServiceLog represents the API handler to remove the logs for a service from the configured backend.
nolint: dupl // ignore similar code with step
func DeleteStep ¶
DeleteStep represents the API handler to remove a step for a build from the configured backend.
nolint: dupl // ignore similar code with service
func DeleteStepLog ¶
DeleteStepLog represents the API handler to remove the logs for a step from the configured backend.
nolint: dupl // ignore similar code with service
func DeleteToken ¶
DeleteToken represents the API handler to revoke and recreate a user token in the configured backend.
func DeleteUser ¶
DeleteUser represents the API handler to remove a user from the configured backend.
func DeleteWorker ¶ added in v0.7.0
DeleteWorker represents the API handler to remove a worker from the configured backend.
func ExpandPipeline ¶ added in v0.7.0
ExpandPipeline represents the API handler to capture and expand a pipeline configuration.
func GetBuild ¶
GetBuild represents the API handler to capture a build for a repo from the configured backend.
func GetBuildLogs ¶
GetBuildLogs represents the API handler to capture a list of logs for a build from the configured backend.
func GetBuilds ¶
GetBuilds represents the API handler to capture a list of builds for a repo from the configured backend.
func GetCurrentUser ¶
GetCurrentUser represents the API handler to capture the currently authenticated user from the configured backend.
func GetDeployment ¶ added in v0.4.0
GetDeployment represents the API handler to capture a deployment from the configured backend.
func GetDeployments ¶ added in v0.4.0
GetDeployments represents the API handler to capture a list of deployments from the configured backend.
func GetHook ¶ added in v0.2.0
GetHook represents the API handler to capture a webhook from the configured backend.
func GetHooks ¶ added in v0.2.0
GetHooks represents the API handler to capture a list of webhooks from the configured backend.
nolint: dupl // ignore false positive
func GetOrgBuilds ¶ added in v0.7.0
GetOrgBuilds represents the API handler to capture a list of builds associated with an org from the configured backend.
func GetOrgRepos ¶ added in v0.9.0
GetOrgRepos represents the API handler to capture a list of repos for a org from the configured backend.
func GetPipeline ¶ added in v0.7.0
GetPipeline represents the API handler to capture a pipeline configuration for a repo from the the source provider.
func GetRepos ¶
GetRepos represents the API handler to capture a list of repos for a user from the configured backend.
nolint: dupl // ignore false positive
func GetSecrets ¶
GetSecrets represents the API handler to capture a list of secrets from the configured backend.
func GetService ¶
GetService represents the API handler to capture a service for a build from the configured backend.
func GetServiceLog ¶
GetServiceLog represents the API handler to capture the logs for a service from the configured backend.
func GetServices ¶
GetServices represents the API handler to capture a list of services for a build from the configured backend.
func GetStep ¶
GetStep represents the API handler to capture a step for a build from the configured backend.
func GetStepLog ¶
GetStepLog represents the API handler to capture the logs for a step from the configured backend.
func GetSteps ¶
GetSteps represents the API handler to capture a list of steps for a build from the configured backend.
func GetTemplates ¶ added in v0.7.0
GetTemplates represents the API handler to capture a map of templates utilized by a pipeline configuration.
func GetUserSourceRepos ¶
GetUserSourceRepos represents the API handler to capture the list of repos for a user from the configured backend.
func GetUsers ¶
GetUsers represents the API handler to capture a list of users from the configured backend.
func GetWorker ¶ added in v0.7.0
GetWorker represents the API handler to capture a worker from the configured backend.
func GetWorkers ¶ added in v0.7.0
GetWorkers represents the API handler to capture a list of workers from the configured backend.
func Logout ¶ added in v0.7.0
Logout represents the API handler to process a user logging out of Vela. Primarily, it deletes the current refresh token cookie.
func PostWebhook ¶
PostWebhook represents the API handler to capture a webhook from a source control provider and publish it to the configure queue.
nolint: funlen,gocyclo // ignore function length and cyclomatic complexity
func RefreshAccessToken ¶ added in v0.7.0
RefreshAccessToken will return a new access token if the provided refresh token via cookie is valid.
func RepairRepo ¶
RepairRepo represents the API handler to remove and then create a webhook for a repo.
func RestartBuild ¶
RestartBuild represents the API handler to restart an existing build in the configured backend.
nolint: funlen // ignore function length due to comments
func UpdateBuild ¶
UpdateBuild represents the API handler to update a build for a repo in the configured backend. nolint: funlen // ignore long function line length
func UpdateCurrentUser ¶ added in v0.3.0
UpdateCurrentUser represents the API handler to capture and update the currently authenticated user from the configured backend.
func UpdateHook ¶ added in v0.2.0
UpdateHook represents the API handler to update a webhook in the configured backend.
func UpdateRepo ¶
UpdateRepo represents the API handler to update a repo in the configured backend.
nolint: funlen // ignore function length due to comments and conditionals
func UpdateSecret ¶
UpdateSecret updates a secret for the provided secrets service.
func UpdateService ¶
UpdateService represents the API handler to update a service for a build in the configured backend.
func UpdateServiceLog ¶
UpdateServiceLog represents the API handler to update the logs for a service in the configured backend.
func UpdateStep ¶
UpdateStep represents the API handler to update a step for a build in the configured backend.
func UpdateStepLog ¶
UpdateStepLog represents the API handler to update the logs for a step in the configured backend.
func UpdateUser ¶
UpdateUser represents the API handler to update a user in the configured backend.
func UpdateWorker ¶ added in v0.7.0
UpdateWorker represents the API handler to create a worker in the configured backend.
func ValidatePipeline ¶ added in v0.7.0
ValidatePipeline represents the API handler to capture, expand and validate a pipeline configuration.
Types ¶
type HeaderLink ¶
HeaderLink will hold the information needed to form a link element in the header.
type Pagination ¶
Pagination holds basic information pertaining to paginating results.
func (*Pagination) HasNext ¶
func (p *Pagination) HasNext() bool
HasNext will return true if there is a next page.
func (*Pagination) HasPages ¶
func (p *Pagination) HasPages() bool
HasPages returns true if there is need to deal with pagination.
func (*Pagination) HasPrev ¶
func (p *Pagination) HasPrev() bool
HasPrev will return true if there is a previous page.
func (*Pagination) NextPage ¶
func (p *Pagination) NextPage() int
NextPage returns the next page number.
func (*Pagination) PrevPage ¶
func (p *Pagination) PrevPage() int
PrevPage returns the previous page number.
func (*Pagination) SetHeaderLink ¶
func (p *Pagination) SetHeaderLink(c *gin.Context)
SetHeaderLink sets the Link HTTP header element to provide clients with paging information refs: - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link - https://tools.ietf.org/html/rfc5988
func (*Pagination) TotalPages ¶
func (p *Pagination) TotalPages() int
TotalPages will return the total number of pages.