packages

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextHome = domain.ContextHome
	ContextRoot = domain.ContextRoot
)

Variables

This section is empty.

Functions

func Base

func Base(source state.Source, context string) string

func Discover

func Discover(base string) ([]string, error)

func ModeFromFile

func ModeFromFile(path string) (string, error)

func NormalizeMode

func NormalizeMode(raw string) (string, error)

func NormalizeModeFlag

func NormalizeModeFlag(raw string, base string) (string, error)

func SaveConfig

func SaveConfig(packageRoot string, config PackageConfig) error

Types

type Deploy

type Deploy string
const (
	DeploySymlink Deploy = "symlink"
	DeployCopy    Deploy = "copy"
)

type Entry

type Entry struct {
	Path   string
	Rel    string
	Dir    bool
	Deploy Deploy
	Mode   string
}

func ApplyConfig

func ApplyConfig(entries []Entry, config PackageConfig) []Entry

func Directories

func Directories(entries []Entry) []Entry

func Enumerate

func Enumerate(root string) ([]Entry, error)

func Leaves

func Leaves(entries []Entry) []Entry

type ErrPackage

type ErrPackage string
const (
	ErrConfigInvalid ErrPackage = "package manifest invalid"
	ErrConfigWrite   ErrPackage = "package manifest write"
)
const ErrPackageNotFound ErrPackage = "package not found"

func (ErrPackage) Error

func (e ErrPackage) Error() string

type FileConfig

type FileConfig struct {
	Path   string `json:"path"`
	Deploy Deploy `json:"deploy"`
	Mode   string `json:"mode,omitempty"`
}

func ConfiguredFile

func ConfiguredFile(config PackageConfig, rel string) (FileConfig, bool)

type Identity

type Identity struct {
	Source  string
	Context string
	Name    string
	Root    string
}

func ResolveIdentity

func ResolveIdentity(source state.Source, context string, rawRef string) (Identity, error)

func (Identity) String

func (p Identity) String() string

type ListOptions

type ListOptions struct {
	SourceID string
	Context  string
}

type Listing

type Listing struct {
	Source   string
	Context  string
	Packages []string
}

func List

func List(options ListOptions) (Listing, error)

type PackageConfig

type PackageConfig struct {
	ManifestPath string       `json:"manifestPath,omitempty"`
	Files        []FileConfig `json:"files"`
}

func LoadConfig

func LoadConfig(packageRoot string, entries []Entry) (PackageConfig, error)

func RemoveFileConfig

func RemoveFileConfig(config PackageConfig, rel string) PackageConfig

func SetFileConfig

func SetFileConfig(config PackageConfig, file FileConfig) PackageConfig

type Resolved

type Resolved struct {
	Identity Identity
	Entries  []Entry
}

func Resolve

func Resolve(source state.Source, context string, refs []string, all bool) ([]Resolved, error)

func ResolveOne

func ResolveOne(source state.Source, context string, name string) (Resolved, error)

type ShowOptions

type ShowOptions struct {
	SourceID string
	Context  string
	Ref      string
}

type Tree

type Tree struct {
	Command string      `json:"-"`
	Context string      `json:"-"`
	Source  string      `json:"-"`
	Package TreePackage `json:"package"`
}

func Show

func Show(options ShowOptions) (Tree, error)

type TreeEntry

type TreeEntry struct {
	Rel  string `json:"rel"`
	Type string `json:"type"`
}

type TreePackage

type TreePackage struct {
	Identity string      `json:"identity"`
	Root     string      `json:"root"`
	Entries  []TreeEntry `json:"entries"`
}

Jump to

Keyboard shortcuts

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