models

package
v1.0.40 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	RepositoryURL string       // Git repository URL (HTTPS or SSH)
	Version       string       // Version constraint (branch, tag, commit hash, or semver)
	SpecPath      string       // Path to the specification file within the repository
	Alias         string       // Optional short alias for the dependency
	Pinned        bool         // Whether the dependency is pinned to a specific commit
	Transitive    []Dependency // Transitive dependencies discovered from external spec.mod
}

Dependency represents a single external specification dependency declaration

func (*Dependency) String

func (d *Dependency) String() string

String returns a string representation of the dependency

func (*Dependency) Validate

func (d *Dependency) Validate() error

Validate checks if the dependency is valid

type DependencyManifest

type DependencyManifest struct {
	Version      string       // Version of the manifest format
	Dependencies []Dependency // List of declared dependencies
	ID           string       // Unique identifier for this spec (for external references)
	Path         string       // File path to this spec (relative to repo root)
	CreatedAt    time.Time    // When the manifest was created
	UpdatedAt    time.Time    // When the manifest was last updated
}

DependencyManifest represents the dependency manifest file (spec.mod)

func NewDependencyManifest

func NewDependencyManifest(version, id, path string) *DependencyManifest

NewDependencyManifest creates a new dependency manifest

func (*DependencyManifest) AddDependency

func (m *DependencyManifest) AddDependency(dep Dependency) error

AddDependency adds a dependency to the manifest

func (*DependencyManifest) RemoveDependency

func (m *DependencyManifest) RemoveDependency(repoURL, specPath string) bool

RemoveDependency removes a dependency from the manifest

type Lockfile

type Lockfile struct {
	Version   string
	Entries   []LockfileEntry
	Timestamp time.Time
	TotalSize int64
}

Lockfile represents the lockfile file (spec.sum) with cryptographic verification

func NewLockfile

func NewLockfile(version string) *Lockfile

NewLockfile creates a new lockfile

func (*Lockfile) AddEntry

func (l *Lockfile) AddEntry(entry LockfileEntry)

AddEntry adds an entry to the lockfile

type LockfileEntry

type LockfileEntry struct {
	RepositoryURL string
	CommitHash    string
	ContentHash   string // SHA-256 hash of the spec file content
	SpecPath      string
	Branch        string
	Size          int64
	FetchedAt     time.Time
}

LockfileEntry represents a single resolved dependency entry in the lockfile

type SpecFile

type SpecFile struct {
	Path     string
	Content  []byte
	Modified time.Time
}

SpecFile represents a specification file

Jump to

Keyboard shortcuts

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