deflect

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxLooseObjects = 1000
	MaxPacks        = 3
	MinPackSize     = 4 * strengthen.GiByte
)
View Source
const (
	DefaultFileSizeLimit = strengthen.MiByte * 50
)
View Source
const (
	ENV_GIT_QUARANTINE_PATH = "GIT_QUARANTINE_PATH"
)
View Source
const (

	// VersionSupported is the only idx version supported.
	// version 3 --> sha1/sha256 object hybrid storage
	VersionSupported uint32 = 2
)

Variables

View Source
var (
	// ErrUnsupportedVersion is returned by Decode when the idx file version
	// is not supported.
	ErrUnsupportedVersion = errors.New("idxfile: Unsupported version")
	// ErrMalformedIdxFile is returned by Decode when the idx file is corrupted.
	ErrMalformedIdxFile = errors.New("idxfile: Malformed IDX file")
)

Functions

func Du

func Du(repoPath string) (int64, error)

func ReadDir

func ReadDir(name string) ([]os.DirEntry, error)

Types

type Filter

type Filter struct {
	*FilterOption
	// contains filtered or unexported fields
}

func NewFilter

func NewFilter(repoPath string, shaFormat git.HashFormat, opts *FilterOption) (*Filter, error)

func (*Filter) Counts

func (f *Filter) Counts() uint32

func (*Filter) Delta

func (f *Filter) Delta() int64

func (*Filter) Du

func (f *Filter) Du() error

func (*Filter) Execute

func (f *Filter) Execute(sr SizeReceiver) error

func (*Filter) FilterPack

func (f *Filter) FilterPack(p *pack) error

func (*Filter) HashLen

func (f *Filter) HashLen() int64

func (*Filter) HugeSUM

func (f *Filter) HugeSUM() int64

func (*Filter) Size

func (f *Filter) Size() int64

type FilterOption

type FilterOption struct {
	Limit          int64 // file size limit: > Limit --> reject
	Rejector       func(oid string, size int64) error
	QuarantineMode bool // If  Quarantine is enable
}

type Pack

type Pack struct {
	Name string
	Size int64
}

type Result

type Result struct {
	Size         int64
	LooseObjects int
	Packs        []*Pack
	TmpPacks     uint32
}

func HousekeepingScan

func HousekeepingScan(repoPath string) (*Result, error)

func (*Result) IsUntidy

func (r *Result) IsUntidy() bool

type SizeReceiver

type SizeReceiver func(size int64) error

Jump to

Keyboard shortcuts

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