usecase

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyGitHubAccessToken means "github access token is empty"
	ErrEmptyGitHubAccessToken = errors.New("github access token is empty")
	// ErrEmptyGitHubOwnerName means "github owner name is empty"
	ErrEmptyGitHubOwnerName = errors.New("github owner name is empty")
	// ErrEmptyRepositoryName means "github repository name is empty"
	ErrEmptyRepositoryName = errors.New("github repository name is empty")
)

Functions

func MinuteDiff

func MinuteDiff(after, before time.Time) int

Types

type LTUsecase

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

LTUsecase implement LeadTimeUsecase

func (*LTUsecase) Stat

Stat return lead time statistics

type LeadTime

type LeadTime struct {
	PullRequests []*PullRequest `json:"pull_requests,omitempty"`
}

type LeadTimeUsecase

type LeadTimeUsecase interface {
	Stat(ctx context.Context, input *LeadTimeUsecaseStatInput) (*LeadTimeUsecaseStatOutput, error)
}

LeadTimeUsecase is use cases for stat leadtime

func NewLeadTimeUsecase

func NewLeadTimeUsecase(gitHubRepo repository.GitHubRepository) LeadTimeUsecase

NewLeadTimeUsecase initialize LTUsecase

type LeadTimeUsecaseStatInput

type LeadTimeUsecaseStatInput struct {
	// Owner is GitHub account name
	Owner string
	// Repository is GitHub repository name
	Repository string
}

LeadTimeUsecaseStatInput is input data for LeadTimeUsecase.Stat().

func (*LeadTimeUsecaseStatInput) Valid

func (lt *LeadTimeUsecaseStatInput) Valid() error

Valid is input data validation

type LeadTimeUsecaseStatOutput

type LeadTimeUsecaseStatOutput struct {
	LeadTime *LeadTime
}

LeadTimeUsecaseStatOutput is output data for LeadTimeUsecase.Stat().

type PullRequest

type PullRequest struct {
	Number           int         `json:"number,omitempty"`
	State            string      `json:"state,omitempty"`
	Title            string      `json:"title,omitempty"`
	FirstCommitAt    time.Time   `json:"first_commit_at,omitempty"`
	CreatedAt        time.Time   `json:"created_at,omitempty"`
	ClosedAt         time.Time   `json:"closed_at,omitempty"`
	MergedAt         time.Time   `json:"merged_at,omitempty"`
	User             *model.User `json:"user,omitempty"`
	MergeTimeMinutes int         `json:"merge_time_minutes,omitempty"`
}

PullRequest is PR information for presentation layer.

Jump to

Keyboard shortcuts

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