usecase

package
v0.0.0-...-50955ac Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package usecase provides application use cases.

For the Dependency Rule it is not allowed to import platform.

Something to clean up in the future: the current usecase for getting statistics is tightly coupled with the github library and thus coupled to github data structures. We should consider to either use generic data structures so we abstract away from the platform and the library, or we should make the usecase github specific.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetStatistics

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

func NewGetStatistics

func NewGetStatistics(githubDataFinder GithubDataFinder, logger *zap.Logger) *GetStatistics

func (*GetStatistics) GetStatistics

func (g *GetStatistics) GetStatistics(
	ctx context.Context,
	from time.Time,
	to time.Time,
	delta time.Duration,
	organization string,
	repositories []string,
	userHandles []string,
) (*statistics.Statistics, error)

type GithubDataFinder

type GithubDataFinder interface {
	FetchAllFor(
		ctx context.Context,
		from time.Time,
		to time.Time,
		delta time.Duration,
		organization string,
		repositories []string,
	) ([]*github.PullRequest, []*github.RepositoryCommit, []*github.PullRequestComment, error)
}

type GithubDataFinderMock

type GithubDataFinderMock struct {
	FetchAllForFunc func(
		ctx context.Context,
		from time.Time,
		to time.Time,
		delta time.Duration,
		organization string,
		repositories []string,
	) ([]*github.PullRequest, []*github.RepositoryCommit, []*github.PullRequestComment, error)
}

func (*GithubDataFinderMock) FetchAllFor

func (g *GithubDataFinderMock) FetchAllFor(
	ctx context.Context,
	from time.Time,
	to time.Time,
	delta time.Duration,
	organization string,
	repositories []string,
) ([]*github.PullRequest, []*github.RepositoryCommit, []*github.PullRequestComment, error)

Jump to

Keyboard shortcuts

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