luarocks

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package luarocks indexes root-level rockspecs and rocks and derives the LuaRocks manifest consumed by the native client.

Index

Constants

View Source
const (
	KindManifest = "luarocks.manifest"
	ManifestPath = "manifest"
	PropName     = "luarocks.name" // [I] exact 7.161.32 property spelling: #216
	PropVersion  = "luarocks.version"
	PropRevision = "luarocks.revision"
	PropArch     = "luarocks.arch"
)

Variables

This section is empty.

Functions

func Serves

func Serves(t repo.PackageType) bool

func ValidateContent

func ValidateContent(ctx context.Context, rc io.ReadSeeker, size int64, id Identity) error

ValidateContent checks complete rock bytes before a remote cache publishes them. The same admission rules protect local uploads and remote downloads.

func VersionID

func VersionID(ctx context.Context, st store.Store, c repo.Config, id Identity) (int64, error)

Types

type Handler

type Handler struct{ generic.Handler }

func (Handler) Admit

func (Handler) Admit(
	ctx context.Context,
	env format.Env,
	c repo.Config,
	w format.Write,
) (format.Write, error)

func (Handler) Classify

func (Handler) Classify(_ repo.Config, path string) format.Class

func (Handler) Deleted

func (Handler) Deleted(
	ctx context.Context,
	env format.Env,
	c repo.Config,
	removed []types.Item,
) error

func (Handler) Deleting

func (Handler) Deleting(ctx context.Context, env format.Env, c repo.Config, it types.Item) error

func (Handler) Deployed

func (Handler) Deployed(ctx context.Context, env format.Env, c repo.Config, it types.Item) error

func (Handler) Inspect

func (Handler) Inspect(
	ctx context.Context,
	env format.Env,
	_ repo.Config,
	w format.Write,
) (any, error)

func (Handler) Owed

func (Handler) Owed(c repo.Config, cached bool, path string) []format.WorkRef

func (Handler) Reindex

func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error

func (Handler) Resolve

func (Handler) Resolve(
	ctx context.Context,
	env format.Env,
	c repo.Config,
	d format.Download,
) (string, error)

func (Handler) Sidecars

func (Handler) Sidecars(_ repo.Config, p string) []string

func (Handler) Work

func (Handler) Work(ctx context.Context, env format.Env, work types.WorkItem) error

Work builds one plain Lua manifest and the five version-specific variants the current LuaRocks client requests. The tree is read afresh on each run, so queued bursts and restores settle to the final committed state.

func (Handler) WorkKinds

func (Handler) WorkKinds() []string

type Identity

type Identity struct{ Name, Version, Revision, Arch string }

Identity is the package coordinate read from a flat LuaRocks filename.

func Parse

func Parse(path string) (Identity, bool)

Parse accepts only the root layout the native client searches. The final -revision is part of LuaRocks' version, not a separate indexed version.

func VersionFile

func VersionFile(
	ctx context.Context,
	st store.Store,
	c repo.Config,
	wanted int64,
) (Identity, error)

VersionFile resolves the numeric version id returned to the native upload client. It returns the rockspec's flat filename and refuses a version that has since been deleted. Scanning packages avoids ephemeral server state.

Jump to

Keyboard shortcuts

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