rest

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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