gitlab

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchProjectPipelines added in v0.9.0

func FetchProjectPipelines(ctx context.Context, glab *_gitlab.Client, pid int64, opt _gitlab.ListProjectPipelinesOptions) ([]*_gitlab.PipelineInfo, error)

func ListProjectMergeRequests added in v0.9.0

func ListProjectMergeRequests(ctx context.Context, glab *_gitlab.Client, pid int64, opt _gitlab.ListProjectMergeRequestsOptions, yield func(p []*_gitlab.MergeRequest) bool) error

func ListProjectPipelines added in v0.9.0

func ListProjectPipelines(ctx context.Context, glab *_gitlab.Client, pid int64, opt _gitlab.ListProjectPipelinesOptions, yield func(p []*_gitlab.PipelineInfo) bool) error

func NewBridgeSpan added in v0.8.0

func NewBridgeSpan(traceID []byte, bridge *typespb.Bridge) *tracepb.ResourceSpans

func NewJobSpan added in v0.8.0

func NewJobSpan(traceID []byte, job *typespb.Job) *tracepb.ResourceSpans

func NewPipelineHierarchyTrace added in v0.8.0

func NewPipelineHierarchyTrace(traceID []byte, parentID []byte, ph *PipelineHierarchy) *typespb.Trace

func NewPipelineSpan added in v0.8.0

func NewPipelineSpan(traceID []byte, parentID []byte, pipeline *typespb.Pipeline) *tracepb.ResourceSpans

func NewSectionSpan added in v0.8.0

func NewSectionSpan(traceID []byte, section *typespb.Section) *tracepb.ResourceSpans

Types

type Client

type Client struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewGitLabClient

func NewGitLabClient(cfg ClientConfig) (*Client, error)

func (*Client) CheckReadiness

func (c *Client) CheckReadiness(ctx context.Context) error

func (*Client) Client added in v0.8.0

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

func (*Client) Configure

func (c *Client) Configure(cfg ClientConfig) error

func (*Client) GetJobLog

func (c *Client) GetJobLog(ctx context.Context, projectID int64, jobID int64) (*bytes.Reader, error)

func (*Client) GetPipeline

func (c *Client) GetPipeline(ctx context.Context, projectID int64, pipelineID int64) (*typespb.Pipeline, error)

func (*Client) GetPipelineBridges added in v0.9.0

func (c *Client) GetPipelineBridges(ctx context.Context, projectID int64, pipelineID int64) ([]*typespb.Bridge, error)

func (*Client) GetPipelineHierarchy

func (c *Client) GetPipelineHierarchy(ctx context.Context, projectID int64, pipelineID int64, opt *GetPipelineHierarchyOptions) (*GetPipelineHierarchyResult, error)

func (*Client) GetPipelineJobs added in v0.9.0

func (c *Client) GetPipelineJobs(ctx context.Context, projectID int64, pipelineID int64) ([]*typespb.Job, error)

func (*Client) GetPipelineTestReport

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

func (*Client) GetPipelineTestReportSummary added in v0.5.1

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

func (*Client) GetProject

func (c *Client) GetProject(ctx context.Context, id int64) (*typespb.Project, error)

func (*Client) ListGroupProjects added in v0.8.0

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

func (*Client) ListNamespaceProjects added in v0.8.0

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

func (*Client) ListUserProjects added in v0.8.0

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

type ClientConfig

type ClientConfig struct {
	URL   string
	Token string

	RateLimit float64
}

type GetPipelineHierarchyOptions

type GetPipelineHierarchyOptions struct {
	FetchSections   bool
	FetchJobMetrics bool
}

type GetPipelineHierarchyResult

type GetPipelineHierarchyResult struct {
	PipelineHierarchy *PipelineHierarchy
	Metrics           []*typespb.Metric
}

type JobLogData

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

func ParseJobLog

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

type ListNamespaceProjectsOptions added in v0.8.0

type ListNamespaceProjectsOptions struct {
	gitlab.ListProjectsOptions

	Kind             string
	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 PipelineHierarchy added in v0.8.0

type PipelineHierarchy struct {
	Pipeline            *typespb.Pipeline    `json:"pipeline"`
	Jobs                []*typespb.Job       `json:"jobs"`
	Sections            []*typespb.Section   `json:"sections"`
	Bridges             []*typespb.Bridge    `json:"bridges"`
	DownstreamPipelines []*PipelineHierarchy `json:"downstream_pipelines"`
}

func (*PipelineHierarchy) GetAllBridges added in v0.8.0

func (ph *PipelineHierarchy) GetAllBridges() []*typespb.Bridge

func (*PipelineHierarchy) GetAllJobs added in v0.8.0

func (ph *PipelineHierarchy) GetAllJobs() []*typespb.Job

func (*PipelineHierarchy) GetAllPipelines added in v0.8.0

func (ph *PipelineHierarchy) GetAllPipelines() []*typespb.Pipeline

func (*PipelineHierarchy) GetAllSections added in v0.8.0

func (ph *PipelineHierarchy) GetAllSections() []*typespb.Section

func (*PipelineHierarchy) GetAllTraces added in v0.8.0

func (ph *PipelineHierarchy) GetAllTraces() []*typespb.Trace

func (*PipelineHierarchy) GetTrace added in v0.8.0

func (ph *PipelineHierarchy) GetTrace() *typespb.Trace

type PipelineTestReportData

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

type PipelineTestReportSummary added in v0.5.1

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

type PipelineTestReportSummaryTestSuite added in v0.5.1

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 added in v0.5.1

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