locator

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locator

type Locator interface {
	Packages() ([]Package, error)
	FindPackage(name string) (Package, bool, error)
	EntryPoint() (bytecode.FullIdentifier, error)
}

func NewLocator

func NewLocator(provider ...Provider) Locator

type ModuleSource

type ModuleSource interface {
	FilePath() string
	Content() []rune
}

func NewModuleSource

func NewModuleSource(filePath string, content []rune) ModuleSource

type Package

type Package interface {
	Info() PackageInfo
	SetInfo(info PackageInfo)
	Sources() map[string][]rune
	NativeFilePaths(platform string) ([]string, error)
	Path() string
}

func NewLoadedPackage

func NewLoadedPackage(info PackageInfo, sources map[string][]rune, path string) Package

type PackageInfo

type PackageInfo struct {
	Name         string         `json:"name"`
	Version      int            `json:"version"`
	NarVersion   int            `json:"nar-version"`
	Dependencies map[string]int `json:"dependencies"`
	Main         string         `json:"main"`
}

type Provider

type Provider interface {
	ExportedPackages() ([]Package, error)
	LoadPackage(name string) (Package, bool, error)
}

func NewDirectoryProvider

func NewDirectoryProvider(root string) Provider

func NewFileSystemPackageProvider

func NewFileSystemPackageProvider(path string) Provider

func NewMemoryPackageProvider

func NewMemoryPackageProvider(info PackageInfo, sources map[string][]rune) Provider

Jump to

Keyboard shortcuts

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