asset

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMaxSizeExceeded = errors.New("asset maximum size exceeded")

Functions

func ScanDirectory

func ScanDirectory(ctx context.Context, dirPath string, logger zerolog.Logger) (iter.Seq[Asset], error)

Types

type ArchivedAsset

type ArchivedAsset interface {
	Asset
	SourcePath() string  // path of the source where the asset was found
	StoredHash() uint64  // hash of the asset stored in the archive
	ArchivePath() string // path of the archive containing the file
}

type Asset

type Asset interface {
	zerolog.LogObjectMarshaler
	Path() string
	Name() string // base name of the file
	Size() int64  // length in bytes for regular files
	ModTime() time.Time
	// compute hash from the filesystem
	ComputeHash() (uint64, error)
}

func NewFromFS

func NewFromFS(path string, info fs.FileInfo) (Asset, error)

Jump to

Keyboard shortcuts

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