goproxy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: LGPL-2.1 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildInfo

func BuildInfo(ctx context.Context, store StorageReaderInterface, overlayObj *overlay.Obj, key string, version string, major string, lc overlay.ListenerCtxObj) ([]byte, error)

BuildInfo returns `@v/<version>.info` JSON for one active version. Missing or inactive versions return serr.ErrNotFound.

func BuildMod

func BuildMod(ctx context.Context, store StorageReaderInterface, overlayObj *overlay.Obj, key string, version string, major string, lc overlay.ListenerCtxObj) ([]byte, error)

BuildMod returns the rewritten or raw `@v/<version>.mod` body. Missing or inactive versions return serr.ErrNotFound; rewrite failures pass through to the caller.

func BuildVersionList

func BuildVersionList(ctx context.Context, store StorageReaderInterface, overlayObj *overlay.Obj, key string, major string, lc overlay.ListenerCtxObj) ([]byte, error)

BuildVersionList returns `@v/list` with publishable versions for a major. Majors without publishable versions return serr.ErrNotFound.

func LatestInfo

func LatestInfo(ctx context.Context, store StorageReaderInterface, overlayObj *overlay.Obj, key string, major string, lc overlay.ListenerCtxObj) (api.GoInfoObj, error)

LatestInfo returns `@latest` as typed go-info for the latest publishable version in a major. Majors without publishable versions return serr.ErrNotFound.

Types

type ArtifactBuilderInterface

type ArtifactBuilderInterface = storage.ArtifactBuilderInterface

ArtifactBuilderInterface and HotFileObj are storage aliases for go-zip builders and disk streaming.

type HotFileObj

type HotFileObj = storage.HotFileObj

ArtifactBuilderInterface and HotFileObj are storage aliases for go-zip builders and disk streaming.

type StorageReaderInterface

type StorageReaderInterface interface {
	GetVersion(ctx context.Context, key string, version string) (core.VersionObj, bool, error)
	GetDetection(ctx context.Context, key string, version string) (core.DetectionObj, bool, error)
	ListVersionsKeyset(ctx context.Context, key string, includeDeleted bool, afterSeq int64, afterVersion string, limit int) ([]core.VersionObj, error)
	RewriteSet(ctx context.Context, key string, version string) ([]core.HashObj, error)
	GetArtifact(ctx context.Context, keyObj core.ArtifactKeyObj) (core.ArtifactObj, bool, error)
	EnsureArtifactFile(ctx context.Context, keyObj core.ArtifactKeyObj, builderObj ArtifactBuilderInterface) (*HotFileObj, error)
	ReadTree(ctx context.Context, treeHashObj core.HashObj) ([]core.TreeEntryObj, error)
	ReadBlob(ctx context.Context, hashObj core.HashObj) ([]byte, error)
}

StorageReaderInterface is the storage read surface for Go overlay detection, versions, objects, and artifact serving.

type ZipHandleObj

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

ZipHandleObj carries a resolved go-zip lookup so a follow-up Open reuses the detection and artifact key without re-querying them: a full GET resolves publishable-detection and artifact metadata once, then materializes with only GetVersion + RewriteSet left.

func ResolveZip

func ResolveZip(ctx context.Context, store StorageReaderInterface, overlayObj *overlay.Obj, key string, version string, major string, lc overlay.ListenerCtxObj) (ZipHandleObj, bool, error)

ResolveZip locates a go-zip (publishable check + artifact metadata) without materialization, so callers answer 304/HEAD/Range before building. Missing versions or inactive Go overlays return found=false.

func (ZipHandleObj) Artifact

func (h ZipHandleObj) Artifact() core.ArtifactObj

Artifact returns the located artifact metadata for ETag/HEAD/Range decisions before materialization.

func (ZipHandleObj) Open

Open materializes the resolved go-zip for streaming, reusing the handle's detection and artifact key. Only GetVersion (tree hash + mod time) and RewriteSet remain before EnsureArtifactFile.

Jump to

Keyboard shortcuts

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