pkgmgr

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPLManifestFileName = "spl.mod"
	SPLLockFileName     = "spl.lock"
)

Variables

View Source
var SanitizePathFn func(userPath string) (string, error) = func(userPath string) (string, error) {
	return filepath.Abs(userPath)
}

SanitizePathFn is a function variable that must be set by the host package to provide path sanitisation. It defaults to filepath.Abs.

Functions

func DefaultModuleName

func DefaultModuleName(dir string) string

func DependencyChecksum

func DependencyChecksum(path string) (string, error)

func DiscoverProjectRoot

func DiscoverProjectRoot(start string) string

func FindNearestModuleFile

func FindNearestModuleFile(startDir, fileName string) (string, error)

func ResolveManifestImport

func ResolveManifestImport(importPath, moduleDir, sourcePath string) (string, bool, error)

ResolveManifestImport resolves an import path using the module manifest/lock. moduleDir and sourcePath are used to locate the nearest manifest. Returns (resolvedPath, matched, error).

func VerifyModuleLock

func VerifyModuleLock(projectDir string) error

func WriteModuleLock

func WriteModuleLock(projectDir string, lock *SPLModuleLock) error

func WriteModuleManifest

func WriteModuleManifest(projectDir string, manifest *SPLModuleManifest) error

Types

type SPLLockedDependency

type SPLLockedDependency struct {
	Source       string `json:"source"`
	ResolvedPath string `json:"resolved_path"`
	Checksum     string `json:"checksum"`
}

type SPLModuleLock

type SPLModuleLock struct {
	Module       string                         `json:"module"`
	Dependencies map[string]SPLLockedDependency `json:"dependencies,omitempty"`
}

func ReadModuleLockFromFile

func ReadModuleLockFromFile(path string) (*SPLModuleLock, error)

func SyncModuleLock

func SyncModuleLock(projectDir string) (*SPLModuleLock, error)

type SPLModuleManifest

type SPLModuleManifest struct {
	Module       string            `json:"module"`
	Dependencies map[string]string `json:"dependencies,omitempty"`
}

func InitModuleManifest

func InitModuleManifest(projectDir, moduleName string) (*SPLModuleManifest, error)

InitModuleManifest creates a new spl.mod manifest in the given project directory and writes it to disk.

func ReadModuleManifestFromFile

func ReadModuleManifestFromFile(path string) (*SPLModuleManifest, error)

Jump to

Keyboard shortcuts

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