rest

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDeployment added in v0.14.0

func ConvertDeployment(deployment *GitLabDeployment) types.Deployment

Types

type Client

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

func NewClient

func NewClient(url string, token string, rateLimit float64) (*Client, error)

func (*Client) Client

func (c *Client) Client() *gitlab.Client

func (*Client) GetJobLogData

func (c *Client) GetJobLogData(ctx context.Context, projectId int64, jobId int64) (JobLogData, error)

func (*Client) GetPipelineTestReport

func (c *Client) GetPipelineTestReport(ctx context.Context, projectID int64, pipelineID int64) (*gitlab.PipelineTestReport, *PipelineTestReportSummary, error)

func (*Client) GetPipelineTestReportSummary

func (c *Client) GetPipelineTestReportSummary(ctx context.Context, projectID int64, pipelineID int64) (*PipelineTestReportSummary, error)

func (*Client) GetProject

func (c *Client) GetProject(ctx context.Context, pid interface{}) (*gitlab.Project, error)

func (*Client) GetProjectDeployments added in v0.14.0

func (c *Client) GetProjectDeployments(ctx context.Context, projectId int64, opt GetProjectDeploymentsOptions) ([]*GitLabDeployment, error)

func (*Client) GetProjectJobArtifact added in v0.15.0

func (c *Client) GetProjectJobArtifact(ctx context.Context, projectPath string, jobId int64, artifactPath string) (*bytes.Reader, error)

func (*Client) ListGroupProjects

func (c *Client) ListGroupProjects(ctx context.Context, gid interface{}, opt gitlab.ListGroupProjectsOptions, yield func(projects []*gitlab.Project) bool) error

func (*Client) ListNamespaceProjects

func (c *Client) ListNamespaceProjects(ctx context.Context, nid interface{}, opt ListNamespaceProjectsOptions, yield func(projects []*gitlab.Project) bool) error

func (*Client) ListUserProjects

func (c *Client) ListUserProjects(ctx context.Context, uid interface{}, opt gitlab.ListProjectsOptions, yield func(projects []*gitlab.Project) bool) error

type GetProjectDeploymentsOptions added in v0.14.0

type GetProjectDeploymentsOptions struct {
	UpdatedAfter  *time.Time
	UpdatedBefore *time.Time
}

type GitLabDeployment added in v0.14.0

type GitLabDeployment struct {
	ID        int        `json:"id"`
	IID       int        `json:"iid"`
	Ref       string     `json:"ref"`
	SHA       string     `json:"sha"`
	Status    string     `json:"status"`
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	User      struct {
		ID       int    `json:"id"`
		Name     string `json:"name"`
		Username string `json:"username"`
	} `json:"user"`
	Environment struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"environment"`
	Deployable struct {
		ID       int    `json:"id"`
		Name     string `json:"name"`
		Pipeline struct {
			ID        int `json:"id"`
			IID       int `json:"iid"`
			ProjectID int `json:"project_id"`
		} `json:"pipeline"`
		WebURL string `json:"web_url"`
	} `json:"deployable"`
	// contains filtered or unexported fields
}

type GitLabEnvironment added in v0.14.0

type GitLabEnvironment struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Tier string `json:"tier"`

	Project struct {
		ID                int    `json:"id"`
		NameWithNamespace string `json:"name_with_namespace"`
	} `json:"project"`
}

type JobLogData

type JobLogData struct {
	Sections []SectionData `json:"sections"`
	Metrics  []MetricData  `json:"metrics"`
}

func ParseJobLog

func ParseJobLog(trace *bytes.Reader) (JobLogData, error)

type ListNamespaceProjectsOptions

type ListNamespaceProjectsOptions struct {
	Kind string

	// both
	gitlab.ListOptions

	Visibility *string

	// only groups
	WithShared       *bool
	IncludeSubgroups *bool
}

type MetricData

type MetricData struct {
	Name      string            `json:"name"`
	Labels    map[string]string `json:"labels"`
	Value     float64           `json:"value"`
	Timestamp int64             `json:"timestamp"`
}

type PipelineTestReportData

type PipelineTestReportData struct {
	TestReport types.TestReport
	TestSuites []types.TestSuite
	TestCases  []types.TestCase
}

type PipelineTestReportSummary

type PipelineTestReportSummary struct {
	Total      *PipelineTestReportSummaryTotal       `json:"total"`
	TestSuites []*PipelineTestReportSummaryTestSuite `json:"test_suites"`
}

type PipelineTestReportSummaryTestSuite

type PipelineTestReportSummaryTestSuite struct {
	Name         string  `json:"name"`
	TotalTime    float64 `json:"total_time"`
	TotalCount   int     `json:"total_count"`
	SuccessCount int     `json:"success_count"`
	FailedCount  int     `json:"failed_count"`
	SkippedCount int     `json:"skipped_count"`
	ErrorCount   int     `json:"error_count"`
	BuildIDs     []int   `json:"build_ids"`
	SuiteError   string  `json:"suite_error"`
}

type PipelineTestReportSummaryTotal

type PipelineTestReportSummaryTotal struct {
	Time       float64 `json:"time"`
	Count      int     `json:"count"`
	Success    int     `json:"success"`
	Failed     int     `json:"failed"`
	Skipped    int     `json:"skipped"`
	Error      int     `json:"error"`
	SuiteError string  `json:"suite_error"`
}

type Project

type Project = gitlab.Project

type SectionData

type SectionData struct {
	Name  string `json:"name"`
	Start int64  `json:"start"`
	End   int64  `json:"end"`
}

Jump to

Keyboard shortcuts

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