github_stat

package
v0.0.0-...-b45cdd6 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoData = fmt.Errorf("no data")
View Source
var ErrRepoTooLarge = rest.BadRequest{Msg: "Too large repository"}

Functions

This section is empty.

Types

type ContentProvider

type ContentProvider interface {
	GetContent(ctx context.Context, user, repo, branch string, tempStorage TempStorage) (_ []FileForPath, close func() error, _ error)
}

type FileForPath

type FileForPath struct {
	Path   string
	Opener Opener
}

type LOCCacher

type LOCCacher interface {
	SetLOCs(ctx context.Context, user, repo, branch string, locs []loc_count.LOCForPath) error
	SetTooLarge(ctx context.Context, user, repo, branch string) error
	GetLOCs(ctx context.Context, user, repo, branch string) ([]loc_count.LOCForPath, error) // error may be ErrNoData
}

type Opener

type Opener = func() (io.ReadCloser, error)

type Service

type Service struct {
	LOCCacher       LOCCacher // possibly nil
	ContentProvider ContentProvider
	// contains filtered or unexported fields
}

func New

func New(locCacher LOCCacher, contentProvider ContentProvider, maxParallelWork int) *Service

func (*Service) GetStat

func (s *Service) GetStat(ctx context.Context, user, repo, branch string, filter, matcher *string, noLOCProvider bool, tempStorage TempStorage) (*loc_count.StatTree, error)

type TempStorage

type TempStorage int
const (
	TempStorageFile TempStorage = iota
	TempStorageRam
)

Jump to

Keyboard shortcuts

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