gitlabscraper

package
v0.0.0-...-4e92c2a Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeStr is the value of "type" key in configuration.
	TypeStr = "gitlab"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	metadata.MetricsBuilderConfig `mapstructure:",squash"`
	confighttp.HTTPClientSettings `mapstructure:",squash"`
	internal.ScraperConfig
	// GitLabOrg is the name of the GitLab organization to scrape (gitlab scraper only)
	GitLabOrg string `mapstructure:"gitlab_org"`

	SearchTopic string `mapstructure:"search_topic"`
	SearchQuery string `mapstructure:"search_query"`
}

Config relating to GitLab Metric Scraper.

type Factory

type Factory struct{}

func (*Factory) CreateDefaultConfig

func (f *Factory) CreateDefaultConfig() internal.Config

func (*Factory) CreateMetricsScraper

func (f *Factory) CreateMetricsScraper(
	ctx context.Context,
	params receiver.CreateSettings,
	cfg internal.Config,
) (scraperhelper.Scraper, error)

type MergeRequestNode

type MergeRequestNode struct {
	// Internal ID of the merge request.
	Iid string `json:"iid"`
	// Title of the merge request.
	Title string `json:"title"`
	// Source branch of the merge request.
	SourceBranch string `json:"sourceBranch"`
	// Target branch of the merge request.
	TargetBranch string `json:"targetBranch"`
	// Timestamp of when the merge request was created.
	CreatedAt time.Time `json:"createdAt"`
	// Timestamp of when the merge request was merged, null if not merged.
	MergedAt time.Time `json:"mergedAt"`
	// Summary of which files were changed in this merge request.
	DiffStatsSummary MergeRequestNodeDiffStatsSummary `json:"diffStatsSummary"`
}

MergeRequestNode includes the requested fields of the GraphQL type MergeRequest.

func (*MergeRequestNode) GetCreatedAt

func (v *MergeRequestNode) GetCreatedAt() time.Time

GetCreatedAt returns MergeRequestNode.CreatedAt, and is useful for accessing the field via an interface.

func (*MergeRequestNode) GetDiffStatsSummary

func (v *MergeRequestNode) GetDiffStatsSummary() MergeRequestNodeDiffStatsSummary

GetDiffStatsSummary returns MergeRequestNode.DiffStatsSummary, and is useful for accessing the field via an interface.

func (*MergeRequestNode) GetIid

func (v *MergeRequestNode) GetIid() string

GetIid returns MergeRequestNode.Iid, and is useful for accessing the field via an interface.

func (*MergeRequestNode) GetMergedAt

func (v *MergeRequestNode) GetMergedAt() time.Time

GetMergedAt returns MergeRequestNode.MergedAt, and is useful for accessing the field via an interface.

func (*MergeRequestNode) GetSourceBranch

func (v *MergeRequestNode) GetSourceBranch() string

GetSourceBranch returns MergeRequestNode.SourceBranch, and is useful for accessing the field via an interface.

func (*MergeRequestNode) GetTargetBranch

func (v *MergeRequestNode) GetTargetBranch() string

GetTargetBranch returns MergeRequestNode.TargetBranch, and is useful for accessing the field via an interface.

func (*MergeRequestNode) GetTitle

func (v *MergeRequestNode) GetTitle() string

GetTitle returns MergeRequestNode.Title, and is useful for accessing the field via an interface.

type MergeRequestNodeDiffStatsSummary

type MergeRequestNodeDiffStatsSummary struct {
	// Number of lines added.
	Additions int `json:"additions"`
	// Number of lines deleted.
	Deletions int `json:"deletions"`
}

MergeRequestNodeDiffStatsSummary includes the requested fields of the GraphQL type DiffStatsSummary. The GraphQL type's documentation follows.

Aggregated summary of changes

func (*MergeRequestNodeDiffStatsSummary) GetAdditions

func (v *MergeRequestNodeDiffStatsSummary) GetAdditions() int

GetAdditions returns MergeRequestNodeDiffStatsSummary.Additions, and is useful for accessing the field via an interface.

func (*MergeRequestNodeDiffStatsSummary) GetDeletions

func (v *MergeRequestNodeDiffStatsSummary) GetDeletions() int

GetDeletions returns MergeRequestNodeDiffStatsSummary.Deletions, and is useful for accessing the field via an interface.

type MergeRequestState

type MergeRequestState string

State of a GitLab merge request

const (
	// Merge request has been merged.
	MergeRequestStateMerged MergeRequestState = "merged"
	// In open state.
	MergeRequestStateOpened MergeRequestState = "opened"
	// In closed state.
	MergeRequestStateClosed MergeRequestState = "closed"
	// Discussion has been locked.
	MergeRequestStateLocked MergeRequestState = "locked"
	// All available.
	MergeRequestStateAll MergeRequestState = "all"
)

Jump to

Keyboard shortcuts

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