usecase

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 8 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 {
	PRstats []*PRStat
}

func (*LeadTime) Ave

func (lt *LeadTime) Ave() float64

func (*LeadTime) Max

func (lt *LeadTime) Max() int

func (*LeadTime) Median

func (lt *LeadTime) Median() float64

func (*LeadTime) Min

func (lt *LeadTime) Min() int

func (*LeadTime) Sum

func (lt *LeadTime) Sum() int

type LeadTimeUsecase

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

LeadTimeUsecase is use cases for stat leadtime

func NewLeadTimeUsecase

func NewLeadTimeUsecase(prService *service.PullRequestService, commitService *service.CommitService) 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 PRStat

type PRStat struct {
	Number           int
	Title            string
	MergeTimeMinutes int
}

type PRUsecase

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

PRUsecase implement PullRequestUsecase

func (*PRUsecase) List

List return all pull request information in a repository.

type PRUsecaseListInput

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

PRUsecaseListInput is input data for PRUsecase.List().

func (*PRUsecaseListInput) Valid

func (pr *PRUsecaseListInput) Valid() error

Valid is input data validation

type PRUsecaseListOutput

type PRUsecaseListOutput struct {
}

PRUsecaseListOutput is output data for PRUsecase.List().

type PullRequest

type PullRequest struct {
	Number    int
	State     string
	Title     string
	CreatedAt time.Time
	ClosedAt  time.Time
	MergedAt  time.Time
	UserName  string
}

PullRequest is PR information for presentation layer.

type PullRequestUsecase

type PullRequestUsecase interface {
	List(ctx context.Context, input *PRUsecaseListInput) (*PRUsecaseListOutput, error)
}

PullRequestUsecase is use cases for obtaining PR information.

func NewPullRequestUsecase

func NewPullRequestUsecase(prService *service.PullRequestService) PullRequestUsecase

NewPullRequestUsecase initialize PRUsecase

Jump to

Keyboard shortcuts

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