handler

package
v0.7.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const TemplatePath = "/config/templates/templates.yaml"

Variables

This section is empty.

Functions

func CreateCloud

func CreateCloud(ctx context.Context) (*api.Cloud, error)

CreateCloud handles the request to create a cloud.

func CreatePipeline

func CreatePipeline(ctx context.Context, projectName, user string) (*api.Pipeline, error)

CreatePipeline handles the request to create a pipeline.

func CreatePipelineRecord

func CreatePipelineRecord(ctx context.Context, projectName, pipelineName, user string) (*api.PipelineRecord, error)

CreatePipelineRecord handles the request to perform pipeline, which will create a pipeline record.

func CreateProject

func CreateProject(ctx context.Context, user string) (*api.Project, error)

CreateProject handles the request to create a project.

func DeleteCloud

func DeleteCloud(ctx context.Context, name string) error

DeleteCloud handles the request to delete the cloud.

func DeletePipeline

func DeletePipeline(ctx context.Context, projectName, pipelineName string) error

DeletePipeline handles the request to delete a pipeline.

func DeletePipelineRecord

func DeletePipelineRecord(ctx context.Context, pipelineRecordID string) error

DeletePipelineRecord handles the request to delete a pipeline record.

func DeleteProject

func DeleteProject(ctx context.Context, name string) error

DeleteProject handles the request to delete a project.

func GetEvent

func GetEvent(ctx context.Context, eventID string) (*api.Event, error)

GetEvent handles the request to get a event.

func GetPipeline

func GetPipeline(ctx context.Context, projectName, pipelineName string, recentCount, recentSuccessCount, recentFailedCount int) (*api.Pipeline, error)

GetPipeline handles the request to get a pipeline.

func GetPipelineRecord

func GetPipelineRecord(ctx context.Context, pipelineRecordID string) (*api.PipelineRecord, error)

GetPipelineRecord handles the request to get a pipeline record.

func GetPipelineRecordLogStream

func GetPipelineRecordLogStream(ctx context.Context, recordID, stage, task string) error

GetPipelineRecordLogStream gets real-time log of pipeline record refering to recordID

func GetPipelineRecordLogs

func GetPipelineRecordLogs(ctx context.Context, projectName, pipelineName, pipelineRecordID, stage, task string, download bool) ([]byte, map[string]string, error)

getPipelineRecordLogs handles the request to get pipeline record logs, only supports finished pipeline records.

func GetPipelineRecordTestResult

func GetPipelineRecordTestResult(ctx context.Context, projectName, pipelineName, pipelineRecordID, fileName string, download bool) ([]byte, map[string]string, error)

GetPipelineRecordTestResult handles the request to get pipeline record test result.

func GetPipelineStatistics

func GetPipelineStatistics(ctx context.Context, projectName, pipelineName string, start, end string) (*api.PipelineStatusStats, error)

GetPipelineStatistics handles the request to get a pipeline's statistics.

func GetProject

func GetProject(ctx context.Context, name string) (*api.Project, error)

GetProject handles the request to get a project.

func GetProjectStatistics

func GetProjectStatistics(ctx context.Context, name, start, end string) (*api.PipelineStatusStats, error)

GetProjectStatistics handles the request to get a project's statistics.

func GetTemplateType

func GetTemplateType(ctx context.Context, name, repo string) (*api.TemplateType, error)

GetTemplateType handles the request to get project type for SCM repositories.

func HandleGithubWebhook

func HandleGithubWebhook(ctx context.Context, pipelineID string) (string, error)

HandleGithubWebhook handles the webhook request from Github. 1. Parse the pipeline id from request path; 2. Get the pipeline by id; 3. Parse the payload from request header; 4. Parse the payload from request body; 5. First get the event type, and handle it according to its type.

func HandleGitlabWebhook

func HandleGitlabWebhook(ctx context.Context, pipelineID string) (string, error)

HandleGitlabWebhook handles the webhook request from Gitlab. 1. Parse the pipeline id from request path; 2. Get the pipeline by id; 3. Parse the payload from request header; 4. Parse the payload from request body; 5. First get the event type, and handle it according to its type.

func HealthCheck

func HealthCheck(ctx context.Context) error

HealthCheck handles the request to check the health of Cyclone server.

func InitHandler

func InitHandler(dataStore *store.DataStore, recordRotationThreshold int) (err error)

func ListBranches

func ListBranches(ctx context.Context, name, repo string) (api.ListResponse, error)

ListBranches handles the request to list branches for SCM repositories.

func ListClouds

func ListClouds(ctx context.Context) (api.ListResponse, error)

ListClouds handles the request to list all clouds.

func ListConfigTemplates

func ListConfigTemplates(ctx context.Context) api.ListResponse

ListConfigTemplates handles the request to list all cyclone built-in pipeline config templates.

func ListPipelineRecordTestResults

func ListPipelineRecordTestResults(ctx context.Context, projectName, pipelineName, pipelineRecordID string) (api.ListResponse, error)

GetPipelineRecordTestResults handles the request to get pipeline record test results.

func ListPipelineRecords

func ListPipelineRecords(ctx context.Context, projectName, pipelineName string) (api.ListResponse, error)

ListPipelineRecords handles the request to list pipeline records.

func ListPipelines

func ListPipelines(ctx context.Context, projectName string, recentCount, recentSuccessCount, recentFailedCount int) (api.ListResponse, error)

ListPipelines handles the request to list pipelines.

func ListProjects

func ListProjects(ctx context.Context) (api.ListResponse, error)

ListProjects handles the request to list projects.

func ListRepos

func ListRepos(ctx context.Context, name string) (api.ListResponse, error)

ListRepos handles the request to list repositories.

func ListTags

func ListTags(ctx context.Context, name, repo string) (api.ListResponse, error)

ListBranches handles the request to list branches for SCM repositories.

func ListWorkers

func ListWorkers(ctx context.Context, cloudName, namespace string) (api.ListResponse, error)

ListWorkers handles the request to list all workers.

func PingCloud

func PingCloud(ctx context.Context, name string) map[string]string

PingCloud handles the request to ping a cloud to check its health.

func ReceivePipelineRecordLogStream

func ReceivePipelineRecordLogStream(ctx context.Context, recordID, stage, task string) error

ReceivePipelineRecordLogStream receives real-time log of pipeline record.

func ReceivePipelineRecordTestResult

func ReceivePipelineRecordTestResult(ctx context.Context, recordID string) error

ReceivePipelineRecordTestResult receives test result file from cyclone worker.

func SetEvent

func SetEvent(ctx context.Context, eventID string) (*api.Event, error)

SetEvent handles the request to set the event.

func UpdatePipeline

func UpdatePipeline(ctx context.Context, projectName, pipelineName string) (*api.Pipeline, error)

UpdatePipeline handles the request to update a pipeline.

func UpdatePipelineRecordStatus

func UpdatePipelineRecordStatus(ctx context.Context, pipelineRecordID string) (*api.PipelineRecord, error)

UpdatePipelineRecordStatus handles the request to update a pipeline record status, only support to set 'Aborted' status for running pipeline records.

func UpdateProject

func UpdateProject(ctx context.Context, name string) (*api.Project, error)

UpdateProject handles the request to update a project.

Types

type GitHubStatusURL

type GitHubStatusURL struct {
}

Jump to

Keyboard shortcuts

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