domain

package
v0.0.0-...-139d2d7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommitListTerminalTemplate = "commitListTerminalTemplate"
	CommitListReleaseTemplate  = "commitListReleaseTemplate"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AverageAggregation

type AverageAggregation struct {
	Comments       float64 `json:"comments"`
	ReviewComments float64 `json:"review_comments"`
	Commits        float64 `json:"commits"`
	Additions      float64 `json:"additions"`
	Deletions      float64 `json:"deletions"`
	ChangedFiles   float64 `json:"changed_files"`

	LeadTime       time.Duration `json:"lead_time"`
	TimeToMerge    time.Duration `json:"time_to_merge"`
	StrLeadTime    string        `json:"str_lead_time"`
	StrTimeToMerge string        `json:"str_time_to_merge"`
}

AverageAggregation describes the average aggregation metrics of data.

type Billable

type Billable struct {
	Ubuntu  JobDetails `json:"UBUNTU"`
	MacOs   JobDetails `json:"MACOS"`
	Windows JobDetails `json:"WINDOWS"`
}

Billable describes the environment specific details for the job executions.

type Commit

type Commit struct {
	Sha     string        `json:"sha"`
	Url     string        `json:"url"`
	Details CommitDetails `json:"commit"`
	Author  User          `json:"author"`
	Files   []CommitFile  `json:"files"`
}

Commit describes the information of a commit.

type CommitDetails

type CommitDetails struct {
	Message      string    `json:"Message"`
	CommentCount int       `json:"comment_count"`
	Committer    Committer `json:"committer"`
}

CommitDetails describes the deepest level commit details that we need.

type CommitFile

type CommitFile struct {
	Filename  string `json:"filename"`
	Additions int    `json:"additions"`
	Deletions int    `json:"deletions"`
	Changes   int    `json:"changes"`
	Status    string `json:"status"`
}

CommitFile describes the file details modified in a commit.

type Committer

type Committer struct {
	Name  string    `json:"name"`
	Email string    `json:"email"`
	Date  time.Time `json:"date"`
}

Committer describes the

type CompareTagsResponse

type CompareTagsResponse struct {
	Commits []Commit `json:"commits"`
}

CompareTagsResponse describes the http response for retrieving the difference between two tags or commits.

type CustomTime

type CustomTime struct {
	time.Time
}

CustomTime describes the time input and output formats that are used across the system.

func (*CustomTime) IsSet

func (ct *CustomTime) IsSet() bool

IsSet checks if the time is actually set.

func (*CustomTime) MarshalJSON

func (ct *CustomTime) MarshalJSON() ([]byte, error)

MarshalJSON for the custom time type.

func (*CustomTime) UnmarshalJSON

func (ct *CustomTime) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON for the custom time type.

type JobDetails

type JobDetails struct {
	TotalMs int64    `json:"total_ms"`
	Jobs    int      `json:"jobs"`
	JobRuns []JobRun `json:"job_runs"`
}

JobDetails describes the job details of an environment

type JobRun

type JobRun struct {
	JobID      int   `json:"job_id"`
	DurationMs int64 `json:"duration_ms"`
}

JobRun describes the details of a job execution.

type Label

type Label struct {
	Name string `json:"name"`
}

Label describes a label of a pull request.

type Meta

type Meta struct {
	PageSize int `json:"page_size"`
	LastPage int `json:"last_page"`
}

Meta describes the metadata of a response.

type PullRequest

type PullRequest struct {
	ID             int               `json:"id"`
	HtmlUrl        string            `json:"html_url"`
	Number         int               `json:"number"`
	Title          string            `json:"title"`
	Creator        User              `json:"user"`
	Reviewers      []User            `json:"requested_reviewers"`
	Labels         []Label           `json:"labels"`
	State          string            `json:"state"`
	ReviewStates   map[string]string `json:"reviews"`
	Mergeable      bool              `json:"mergeable"`
	MergeCommitSha string            `json:"merge_commit_sha"`
	CreatedAt      time.Time         `json:"created_at"`
	UpdatedAt      time.Time         `json:"updated_at"`
	ClosedAt       time.Time         `json:"closed_at"`
	MergedAt       time.Time         `json:"merged_at"`

	Comments       int `json:"comments"`
	ReviewComments int `json:"review_comments"`
	Commits        int `json:"commits"`
	Additions      int `json:"additions"`
	Deletions      int `json:"deletions"`
	ChangedFiles   int `json:"changed_files"`
}

PullRequest describes the details of a pull request.

type PullRequestFlowRatio

type PullRequestFlowRatio struct {
	Created int    `json:"created"`
	Merged  int    `json:"merged"`
	Ratio   string `json:"ratio"`
}

PullRequestFlowRatio describes the flow ratio information for the pull requests.

type PullRequestMetricDetails

type PullRequestMetricDetails struct {
	Number         int           `json:"number"`
	Title          string        `json:"title"`
	LeadTime       time.Duration `json:"lead_time"`
	TimeToMerge    time.Duration `json:"time_to_merge"`
	StrLeadTime    string        `json:"str_lead_time"`
	StrTimeToMerge string        `json:"str_time_to_merge"`
	CreatedAt      time.Time     `json:"created_at"`

	Comments       int `json:"comments"`
	ReviewComments int `json:"review_comments"`
	Commits        int `json:"commits"`
	Additions      int `json:"additions"`
	Deletions      int `json:"deletions"`
	ChangedFiles   int `json:"changed_files"`
}

PullRequestMetricDetails describes the pull request lead time details to be kept.

type PullRequestMetrics

type PullRequestMetrics struct {
	PRDetails []PullRequestMetricDetails `json:"pr_metrics"`
	Total     TotalAggregation           `json:"total"`
	Average   AverageAggregation         `jsom:"average"`
}

PullRequestMetrics describes the full details required for the metrics.

type PullRequestReview

type PullRequestReview struct {
	ID          int       `json:"id"`
	State       string    `json:"state"`
	User        User      `json:"user"`
	SubmittedAt time.Time `json:"submitted_at"`
}

PullRequestReview describes the state of the pull request reviews.

type Release

type Release struct {
	ID          int       `json:"id"`
	Url         string    `json:"url"`
	HtmlUrl     string    `json:"html_url"`
	TagName     string    `json:"tag_name"`
	Name        string    `json:"name"`
	Body        string    `json:"body"`
	Draft       bool      `json:"draft"`
	PreRelease  bool      `json:"prerelease"`
	CreatedAt   time.Time `json:"created_at"`
	PublishedAt time.Time `json:"published_at"`
}

Release describes the release details.

type ReleaseReport

type ReleaseReport struct {
	NumberOfDraftReleases     int `json:"number_of_draft_releases"`
	NumberOfPreReleases       int `json:"number_of_pre_releases"`
	NumberOfReleasesCreated   int `json:"number_of_releases_created"`
	NumberOfReleasesPublished int `json:"number_of_releases_published"`

	CreatedToPublishedRatio float64 `json:"created_to_published_ratio"`
}

ReleaseReport describes the fields to generate reports for releases.

func (*ReleaseReport) CalculateRatioFields

func (rr *ReleaseReport) CalculateRatioFields()

CalculateRatioFields of the release report.

type RepoPullRequestsResponse

type RepoPullRequestsResponse struct {
	PullRequests []PullRequest `json:"pull_requests"`
	Meta         Meta          `json:"meta"`
}

RepoPullRequestsResponse describes the http response for retrieving the pull requests of a repository.

type Repository

type Repository struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	FullName    string `json:"full_name"`
	Description string `json:"description"`
	HtmlUrl     string `json:"html_url"`
	SshUrl      string `json:"ssh_url"`
	Private     bool   `json:"private"`
	Language    string `json:"language"`
	Stars       int    `json:"stargazers_count"`
}

Repository describes the required details to keep for a repo.

type SprintSummary

type SprintSummary struct {
	Number    int        `json:"number"`
	Name      string     `json:"name"`
	StartDate CustomTime `json:"start_date"`
	EndDate   CustomTime `json:"end_date"`
}

SprintSummary describe the sprint summary level details.

type TotalAggregation

type TotalAggregation struct {
	Comments       int `json:"comments"`
	ReviewComments int `json:"review_comments"`
	Commits        int `json:"commits"`
	Additions      int `json:"additions"`
	Deletions      int `json:"deletions"`
	ChangedFiles   int `json:"changed_files"`

	LeadTime       time.Duration `json:"lead_time"`
	TimeToMerge    time.Duration `json:"time_to_merge"`
	StrLeadTime    string        `json:"str_lead_time"`
	StrTimeToMerge string        `json:"str_time_to_merge"`
}

TotalAggregation describes the total aggregation metrics of data.

type User

type User struct {
	ID       int    `json:"id"`
	Username string `json:"login"`
}

User describes a user account.

type UserReposResponse

type UserReposResponse struct {
	Repositories []Repository `json:"repositories"`
	Meta         Meta         `json:"meta"`
}

UserReposResponse describes the http response for retrieving user repositories.

type Workflow

type Workflow struct {
	ID    int    `json:"id"`
	Name  string `json:"name"`
	State string `json:"state"`
}

Workflow describes the information of a commit.

type WorkflowBilling

type WorkflowBilling struct {
	Name          string
	WorkflowCosts []WorkflowCosts
}

WorkflowBilling describes the billing information of a workflow.

type WorkflowCosts

type WorkflowCosts struct {
	EnvType     string
	ExecMinutes int64
	Cost        float32
}

WorkflowCosts describes the cost of a workflow.

type WorkflowResponse

type WorkflowResponse struct {
	TotalCount      int        `json:"total_count"`
	WorkflowRuns    []Workflow `json:"workflow_runs"`
	WorkflowDetails []Workflow `json:"workflows"`
}

WorkflowResponse describes the response to get the workflows of a repository.

type WorkflowTiming

type WorkflowTiming struct {
	Billable      Billable `json:"billable"`
	RunDurationMs int      `json:"run_duration_ms"`
}

WorkflowTiming describes the timing details for a workflow execution.

Jump to

Keyboard shortcuts

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