artifact

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DownloadTimeout = 5 * time.Minute

Variables

This section is empty.

Functions

func NewHasher

func NewHasher(algorithm string) (hash.Hash, error)

func VerifyHashFromDigest

func VerifyHashFromDigest(digest []byte, expectedHash, algorithm string) error

Types

type ArtifactExtraction added in v0.1.0

type ArtifactExtraction struct {
	Ecosystem       string            `json:"ecosystem"`
	PackageName     string            `json:"package_name"`
	TarballFilename string            `json:"tarball_filename,omitempty"`
	Files           map[string]string `json:"files"`
	ArtifactURL     string            `json:"artifact_url,omitempty"`
	Verified        bool              `json:"verified"`
	VerifyError     *string           `json:"verify_error,omitempty"`
	SkipReason      *string           `json:"skip_reason,omitempty"`
}

ArtifactExtraction holds the manifest/text files extracted from a package artifact, along with hash-verification status.

type ExtractionResult

type ExtractionResult struct {
	Files       map[string]string
	Verified    bool
	VerifyError *string
}

func StreamExtractAndVerify

func StreamExtractAndVerify(ctx context.Context, dist *models.DistributionInfo, filename, ecosystem string) (*ExtractionResult, error)

type StreamResult

type StreamResult struct {
	Body        io.ReadCloser
	ContentType string
}

func StreamDownload

func StreamDownload(ctx context.Context, url string) (*StreamResult, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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