lockfile

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Filename        = "scribe.lock"
	ProjectFilename = "scribe.lock"
	ProjectKind     = "ProjectLock"
	SchemaVersion   = 1
)
View Source
const ContentHashFilename = ".scribe-content-hash"

Variables

This section is empty.

Functions

func CommandHash

func CommandHash(parts ...string) string

func HashDir

func HashDir(root string) (string, error)

func HashFiles

func HashFiles(files []File) (string, error)

func HashSet

func HashSet(root string) (string, error)

HashSet hashes the project-share content set for root.

Types

type Entry

type Entry struct {
	Name               string             `yaml:"name" json:"name"`
	SourceRegistry     string             `yaml:"source_registry" json:"source_registry"`
	CommitSHA          string             `yaml:"commit_sha" json:"commit_sha"`
	ContentHash        string             `yaml:"content_hash" json:"content_hash"`
	InstallCommandHash string             `yaml:"install_command_hash,omitempty" json:"install_command_hash,omitempty"`
	SourceKey          string             `yaml:"source_key,omitempty" json:"source_key,omitempty"`
	Source             *source.SourceSpec `yaml:"source,omitempty" json:"source,omitempty"`
	ResolvedRev        string             `yaml:"resolved_rev,omitempty" json:"resolved_rev,omitempty"`
}

type File

type File struct {
	Path    string
	Content []byte
}

type Lockfile

type Lockfile struct {
	FormatVersion int     `yaml:"format_version"`
	Registry      string  `yaml:"registry"`
	Entries       []Entry `yaml:"entries"`
}

func Parse

func Parse(data []byte) (*Lockfile, error)

func (*Lockfile) Encode

func (lf *Lockfile) Encode() ([]byte, error)

func (*Lockfile) Entry

func (lf *Lockfile) Entry(name string) (Entry, bool)

func (*Lockfile) Validate

func (lf *Lockfile) Validate() error

type ProjectEntry

type ProjectEntry struct {
	Entry      `yaml:",inline"`
	SourceRepo string            `yaml:"source_repo,omitempty" json:"source_repo,omitempty"`
	Path       string            `yaml:"path,omitempty" json:"path,omitempty"`
	Type       string            `yaml:"type,omitempty" json:"type,omitempty"`
	Install    string            `yaml:"install,omitempty" json:"install,omitempty"`
	Update     string            `yaml:"update,omitempty" json:"update,omitempty"`
	Installs   map[string]string `yaml:"installs,omitempty" json:"installs,omitempty"`
	Updates    map[string]string `yaml:"updates,omitempty" json:"updates,omitempty"`
}

type ProjectKit

type ProjectKit struct {
	Name           string   `yaml:"name" json:"name"`
	SourceRegistry string   `yaml:"source_registry" json:"source_registry"`
	CommitSHA      string   `yaml:"commit_sha" json:"commit_sha"`
	ContentHash    string   `yaml:"content_hash" json:"content_hash"`
	SkillsRefs     []string `yaml:"skills_refs,omitempty" json:"skills_refs,omitempty"`
}

type ProjectLockfile

type ProjectLockfile struct {
	FormatVersion int            `yaml:"format_version"`
	Kind          string         `yaml:"kind"`
	GeneratedAt   string         `yaml:"generated_at,omitempty"`
	GeneratedBy   string         `yaml:"generated_by,omitempty"`
	Kits          []ProjectKit   `yaml:"kits,omitempty"`
	Entries       []ProjectEntry `yaml:"entries"`
}

func ParseProject

func ParseProject(data []byte) (*ProjectLockfile, error)

func (*ProjectLockfile) Encode

func (lf *ProjectLockfile) Encode() ([]byte, error)

func (*ProjectLockfile) Entry

func (lf *ProjectLockfile) Entry(name string) (ProjectEntry, bool)

func (*ProjectLockfile) Validate

func (lf *ProjectLockfile) Validate() error

type Update

type Update struct {
	Name        string `json:"name"`
	CurrentSHA  string `json:"current_sha"`
	LatestSHA   string `json:"latest_sha"`
	CurrentHash string `json:"current_hash"`
	LatestHash  string `json:"latest_hash"`
}

func Diff

func Diff(current, latest *Lockfile) []Update

Jump to

Keyboard shortcuts

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