registry

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const IndexSchemaVersion = 1

Variables

This section is empty.

Functions

func CanonicalFileBytes added in v0.1.1

func CanonicalFileBytes(name string, data []byte) []byte

func CleanBundlePath

func CleanBundlePath(name string) (string, error)

Types

type Bundle

type Bundle struct {
	Index    *Index
	Manifest Manifest
	// contains filtered or unexported fields
}

func NewBundle

func NewBundle(zipBytes, manifestBytes []byte) (*Bundle, error)

func (*Bundle) HasFile

func (b *Bundle) HasFile(name string) bool

func (*Bundle) ListFiles

func (b *Bundle) ListFiles(prefix string) []string

func (*Bundle) ModuleFiles

func (b *Bundle) ModuleFiles(module Module, standalone bool) ([]ModuleFile, error)

func (*Bundle) ReadFile

func (b *Bundle) ReadFile(name string) ([]byte, error)

type BundleFile

type BundleFile struct {
	Path          string `json:"path"`
	Module        string `json:"module,omitempty"`
	ModuleVersion string `json:"moduleVersion,omitempty"`
	SHA256        string `json:"sha256"`
	Size          int64  `json:"size"`
}

type BundleModule

type BundleModule struct {
	ID      string `json:"id"`
	Version string `json:"version"`
	Source  string `json:"source"`
}

type Index

type Index struct {
	SchemaVersion int      `json:"schemaVersion"`
	Name          string   `json:"name"`
	Version       string   `json:"version"`
	Description   string   `json:"description"`
	Patterns      []Module `json:"patterns"`
}

func ParseIndex

func ParseIndex(data []byte) (*Index, error)

func (*Index) Module

func (idx *Index) Module(id string) (Module, bool)

func (*Index) SortedModules

func (idx *Index) SortedModules() []Module

type Manifest

type Manifest struct {
	SchemaVersion   int            `json:"schemaVersion"`
	RegistryVersion string         `json:"registryVersion"`
	BundleHash      string         `json:"bundleHash"`
	Modules         []BundleModule `json:"modules"`
	Files           []BundleFile   `json:"files"`
}

type Module

type Module struct {
	ID                string   `json:"id"`
	Name              string   `json:"name"`
	Description       string   `json:"description"`
	Path              string   `json:"path"`
	Languages         []string `json:"languages"`
	Frameworks        []string `json:"frameworks"`
	Tags              []string `json:"tags"`
	Version           string   `json:"version"`
	Package           string   `json:"package"`
	Source            string   `json:"source"`
	DefaultTarget     string   `json:"defaultTarget"`
	StdlibOnly        bool     `json:"stdlibOnly"`
	Include           []string `json:"include"`
	StandaloneInclude []string `json:"standaloneInclude"`
	Status            string   `json:"status"`
}

type ModuleFile

type ModuleFile struct {
	SourcePath   string
	RelativePath string
	SHA256       string
	Size         int64
}

Jump to

Keyboard shortcuts

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