client

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package client contains all the files to extract the information from gitlab

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovalStats added in v0.0.3

type ApprovalStats struct {
	Approvals int
	ID        string
	ProjectID string
}

ApprovalStats is the struct for Gitlab Approvals data we want

type ChangeStats added in v0.0.8

type ChangeStats struct {
	ProjectID string
	ID        string
	Additions int
	Deletions int
}

ChangeStats is the struct for the total amount of changes within a MR.

type ExporterClient

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

ExporterClient contains Gitlab information for connecting

func New

New returns a new Client connection to Gitlab.

func (*ExporterClient) GetStats

func (c *ExporterClient) GetStats() (*Stats, error)

GetStats retrieves data from API to create metrics from.

type MergeClosedStats added in v0.0.4

type MergeClosedStats struct {
	MergeRequest MergeRequestStats
	ClosedAt     *time.Time
	Duration     float64
}

MergeClosedStats is the struct for closed merge requests

type MergeMergedStats added in v0.0.4

type MergeMergedStats struct {
	MergeRequest MergeRequestStats
	MergedAt     *time.Time
	Duration     float64
}

MergeMergedStats is the strucct for merged merge requests

type MergeRequestStats

type MergeRequestStats struct {
	ID           string
	InternalID   int
	State        string
	TargetBranch string
	SourceBranch string
	ProjectID    string
	ChangeCount  string
	Title        string
	LastUpdated  *time.Time
	CreatedAt    *time.Time
	Assignees    int
}

MergeRequestStats is the base struct for Gitlab Merge Requests data we want

type ProjectStats

type ProjectStats struct {
	ID                string
	PathWithNamespace string
}

ProjectStats is the struct for Gitlab projects data we want.

type Stats

type Stats struct {
	Projects            *[]ProjectStats
	MergeRequests       *[]MergeRequestStats
	MergeRequestsOpen   *[]MergeRequestStats
	MergeRequestsClosed *[]MergeClosedStats
	MergeRequestsMerged *[]MergeMergedStats
	Approvals           *[]ApprovalStats
	Changes             *[]ChangeStats
}

Stats struct is the list of expected to results to export.

var CachedStats *Stats = &Stats{
	Projects:            &[]ProjectStats{},
	MergeRequests:       &[]MergeRequestStats{},
	MergeRequestsOpen:   &[]MergeRequestStats{},
	MergeRequestsClosed: &[]MergeClosedStats{},
	MergeRequestsMerged: &[]MergeMergedStats{},
	Approvals:           &[]ApprovalStats{},
	Changes:             &[]ChangeStats{},
}

CachedStats is to store scraped data for caching purposes.

Jump to

Keyboard shortcuts

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