api

package
v0.2.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package api provides the handlers for the Vela API.

Usage:

import "github.com/go-vela/server/api"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(c *gin.Context)

Authenticate represents the API handler to process a user logging in to Vela from the API or UI.

func AuthenticateCLI

func AuthenticateCLI(c *gin.Context)

AuthenticateCLI represents the API handler to process a user logging in to Vela from the CLI.

func BaseMetrics

func BaseMetrics() http.Handler

BaseMetrics returns a Prometheus handler for serving go metrics

func ChownRepo

func ChownRepo(c *gin.Context)

ChownRepo represents the API handler to change the owner of a repo in the configured backend.

func CreateBuild

func CreateBuild(c *gin.Context)

CreateBuild represents the API handler to create a build in the configured backend.

func CreateHook added in v0.2.0

func CreateHook(c *gin.Context)

CreateHook represents the API handler to create a webhook in the configured backend.

func CreateRepo

func CreateRepo(c *gin.Context)

CreateRepo represents the API handler to create a repo in the configured backend.

func CreateSecret

func CreateSecret(c *gin.Context)

CreateSecret represents the API handler to create a secret in the configured backend.

func CreateService

func CreateService(c *gin.Context)

CreateService represents the API handler to create a service for a build in the configured backend.

func CreateServiceLog

func CreateServiceLog(c *gin.Context)

CreateServiceLog represents the API handler to create the logs for a service in the configured backend.

func CreateStep

func CreateStep(c *gin.Context)

CreateStep represents the API handler to create a step for a build in the configured backend.

func CreateStepLog

func CreateStepLog(c *gin.Context)

CreateStepLog represents the API handler to create the logs for a step in the configured backend.

func CreateToken

func CreateToken(c *gin.Context)

CreateToken represents the API handler to create a user token in the configured backend.

func CreateUser

func CreateUser(c *gin.Context)

CreateUser represents the API handler to create a user in the configured backend.

func CustomMetrics

func CustomMetrics(c *gin.Context)

CustomMetrics returns custom Prometheus metrics from private functions

func DeleteBuild

func DeleteBuild(c *gin.Context)

DeleteBuild represents the API handler to remove a build for a repo from the configured backend.

func DeleteHook added in v0.2.0

func DeleteHook(c *gin.Context)

DeleteHook represents the API handler to remove a webhook from the configured backend.

func DeleteRepo

func DeleteRepo(c *gin.Context)

DeleteRepo represents the API handler to remove a repo from the configured backend.

func DeleteSecret

func DeleteSecret(c *gin.Context)

DeleteSecret deletes a secret from the provided secrets service.

func DeleteService

func DeleteService(c *gin.Context)

DeleteService represents the API handler to remove a service for a build from the configured backend.

func DeleteServiceLog

func DeleteServiceLog(c *gin.Context)

DeleteServiceLog represents the API handler to remove the logs for a service from the configured backend.

func DeleteStep

func DeleteStep(c *gin.Context)

DeleteStep represents the API handler to remove a step for a build from the configured backend.

func DeleteStepLog

func DeleteStepLog(c *gin.Context)

DeleteStepLog represents the API handler to remove the logs for a step from the configured backend.

func DeleteToken

func DeleteToken(c *gin.Context)

DeleteToken represents the API handler to revoke and recreate a user token in the configured backend.

func DeleteUser

func DeleteUser(c *gin.Context)

DeleteUser represents the API handler to remove a user from the configured backend.

func GetBuild

func GetBuild(c *gin.Context)

GetBuild represents the API handler to capture a build for a repo from the configured backend.

func GetBuildLogs

func GetBuildLogs(c *gin.Context)

GetBuildLogs represents the API handler to capture a list of logs for a build from the configured backend.

func GetBuilds

func GetBuilds(c *gin.Context)

GetBuilds represents the API handler to capture a list of builds for a repo from the configured backend.

func GetCurrentUser

func GetCurrentUser(c *gin.Context)

GetCurrentUser represents the API handler to capture the currently authenticated user from the configured backend.

func GetHook added in v0.2.0

func GetHook(c *gin.Context)

GetHook represents the API handler to capture a webhook from the configured backend.

func GetHooks added in v0.2.0

func GetHooks(c *gin.Context)

GetHooks represents the API handler to capture a list of webhooks from the configured backend.

func GetRepo

func GetRepo(c *gin.Context)

GetRepo represents the API handler to capture a repo from the configured backend.

func GetRepos

func GetRepos(c *gin.Context)

GetRepos represents the API handler to capture a list of repos for a user from the configured backend.

func GetSecret

func GetSecret(c *gin.Context)

GetSecret gets a secret from the provided secrets service.

func GetSecrets

func GetSecrets(c *gin.Context)

GetSecrets represents the API handler to capture a list of secrets from the configured backend.

func GetService

func GetService(c *gin.Context)

GetService represents the API handler to capture a service for a build from the configured backend.

func GetServiceLog

func GetServiceLog(c *gin.Context)

GetServiceLog represents the API handler to capture the logs for a service from the configured backend.

func GetServices

func GetServices(c *gin.Context)

GetServices represents the API handler to capture a list of services for a build from the configured backend.

func GetStep

func GetStep(c *gin.Context)

GetStep represents the API handler to capture a step for a build from the configured backend.

func GetStepLog

func GetStepLog(c *gin.Context)

GetStepLog represents the API handler to capture the logs for a step from the configured backend.

func GetSteps

func GetSteps(c *gin.Context)

GetSteps represents the API handler to capture a list of steps for a build from the configured backend.

func GetUser

func GetUser(c *gin.Context)

GetUser represents the API handler to capture a user from the configured backend.

func GetUserSourceRepos

func GetUserSourceRepos(c *gin.Context)

GetUserSourceRepos represents the API handler to capture the list of repos for a user from the configured backend.

func GetUsers

func GetUsers(c *gin.Context)

GetUsers represents the API handler to capture a list of users from the configured backend.

func Health

func Health(c *gin.Context)

Health represents the API handler to report the health status for Vela.

func Login

func Login(c *gin.Context)

Login represents the API handler to process a user logging in to Vela.

func PostWebhook

func PostWebhook(c *gin.Context)

PostWebhook represents the API handler to capture a webhook from a source control provider and publish it to the configure queue.

func RepairRepo

func RepairRepo(c *gin.Context)

RepairRepo represents the API handler to remove and then create a webhook for a repo.

func RestartBuild

func RestartBuild(c *gin.Context)

RestartBuild represents the API handler to restart an existing build in the configured backend.

func UpdateBuild

func UpdateBuild(c *gin.Context)

UpdateBuild represents the API handler to update a build for a repo in the configured backend.

func UpdateHook added in v0.2.0

func UpdateHook(c *gin.Context)

UpdateHook represents the API handler to update a webhook in the configured backend.

func UpdateRepo

func UpdateRepo(c *gin.Context)

UpdateRepo represents the API handler to update a repo in the configured backend.

func UpdateSecret

func UpdateSecret(c *gin.Context)

UpdateSecret updates a secret for the provided secrets service.

func UpdateService

func UpdateService(c *gin.Context)

UpdateService represents the API handler to update a service for a build in the configured backend.

func UpdateServiceLog

func UpdateServiceLog(c *gin.Context)

UpdateServiceLog represents the API handler to update the logs for a service in the configured backend.

func UpdateStep

func UpdateStep(c *gin.Context)

UpdateStep represents the API handler to update a step for a build in the configured backend.

func UpdateStepLog

func UpdateStepLog(c *gin.Context)

UpdateStepLog represents the API handler to update the logs for a step in the configured backend.

func UpdateUser

func UpdateUser(c *gin.Context)

UpdateUser represents the API handler to update a user in the configured backend.

Types

type HeaderLink map[string]int

HeaderLink will hold the information needed to form a link element in the header

type Pagination

type Pagination struct {
	PerPage int
	Page    int
	Total   int64
}

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 (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

Directories

Path Synopsis
Package admin provides the admin handlers for the Vela API.
Package admin provides the admin handlers for the Vela API.

Jump to

Keyboard shortcuts

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