Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultModuleName(dir string) string
- func DependencyChecksum(path string) (string, error)
- func DiscoverProjectRoot(start string) string
- func FindNearestModuleFile(startDir, fileName string) (string, error)
- func ResolveManifestImport(importPath, moduleDir, sourcePath string) (string, bool, error)
- func VerifyModuleLock(projectDir string) error
- func WriteModuleLock(projectDir string, lock *SPLModuleLock) error
- func WriteModuleManifest(projectDir string, manifest *SPLModuleManifest) error
- type SPLLockedDependency
- type SPLModuleLock
- type SPLModuleManifest
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 DependencyChecksum ¶
func DiscoverProjectRoot ¶
func FindNearestModuleFile ¶
func ResolveManifestImport ¶
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 WriteModuleLock ¶
func WriteModuleLock(projectDir string, lock *SPLModuleLock) error
func WriteModuleManifest ¶
func WriteModuleManifest(projectDir string, manifest *SPLModuleManifest) error
Types ¶
type SPLLockedDependency ¶
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)
Click to show internal directories.
Click to hide internal directories.