local

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XXH3 digest.Algorithm = "xxh3"
)

Variables

This section is empty.

Functions

func NewSource

func NewSource(opt Opt) (source.Source, error)

Types

type CacheRefMetadata

type CacheRefMetadata struct {
	cache.RefMetadata
}

type CachedResult

type CachedResult[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*CachedResult[K, V]) Release

func (res *CachedResult[K, V]) Release()

func (*CachedResult[K, V]) Result

func (res *CachedResult[K, V]) Result() V

type ChangeFunc

type ChangeFunc func(kind ChangeKind, path string, lowerStat, upperStat *types.Stat) error

type ChangeKind

type ChangeKind = fsutil.ChangeKind
const (
	ChangeKindAdd    ChangeKind = fsutil.ChangeKindAdd
	ChangeKindModify ChangeKind = fsutil.ChangeKindModify
	ChangeKindDelete ChangeKind = fsutil.ChangeKindDelete
	ChangeKindNone   ChangeKind = fsutil.ChangeKindDelete + 1
)

type ChangeWithStat

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

type ErrConflict

type ErrConflict struct {
	Path      string
	FieldName string
	OldVal    string
	NewVal    string
}

func (*ErrConflict) Error

func (e *ErrConflict) Error() string

type HashedStatInfo

type HashedStatInfo struct {
	StatInfo
	// contains filtered or unexported fields
}

func (*HashedStatInfo) Digest

func (s *HashedStatInfo) Digest() digest.Digest

type Opt

type Opt struct {
	CacheAccessor cache.Accessor
}

type ReadFS

type ReadFS interface {
	WalkFS
	ReadFile(ctx context.Context, path string) (io.ReadCloser, error)
}

type SingleflightGroup

type SingleflightGroup[K comparable, V any] struct {
	// contains filtered or unexported fields
}

SingleflightGroup is similar to sync.Singleflight but: 1. Handles context cancellation (ctx provided to callback is only cancelled once no one is waiting on the result) 2. Caches results until all returned CachedResults are released

func (*SingleflightGroup[K, V]) Do

func (g *SingleflightGroup[K, V]) Do(ctx context.Context, key K, fn func(context.Context) (V, error)) (*CachedResult[K, V], error)

type StatInfo

type StatInfo struct {
	*types.Stat
}

func (*StatInfo) Info

func (s *StatInfo) Info() (fs.FileInfo, error)

func (*StatInfo) IsDir

func (s *StatInfo) IsDir() bool

func (*StatInfo) ModTime

func (s *StatInfo) ModTime() time.Time

func (*StatInfo) Mode

func (s *StatInfo) Mode() os.FileMode

func (*StatInfo) Name

func (s *StatInfo) Name() string

func (*StatInfo) Size

func (s *StatInfo) Size() int64

func (*StatInfo) Sys

func (s *StatInfo) Sys() interface{}

func (*StatInfo) Type

func (s *StatInfo) Type() fs.FileMode

type WalkFS

type WalkFS interface {
	Walk(ctx context.Context, path string, walkFn fs.WalkDirFunc) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳