packages

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallConfigured

func InstallConfigured(ctx context.Context, installer *Installer, specs []InstallSpec) error

InstallConfigured installs each spec idempotently. Already-complete package versions are skipped without error.

Types

type InstallResult

type InstallResult struct {
	PackageID   string   `json:"packageId"`
	Version     string   `json:"version"`
	Installed   int      `json:"installedDefinitions"`
	Enabled     []string `json:"enabledResources,omitempty"`
	ExtractedTo string   `json:"extractedTo,omitempty"`
}

InstallResult summarizes a package install.

type InstallSpec

type InstallSpec struct {
	PackageID string
	Version   string
	Path      string // local directory; when set, installs from disk instead of the registry
}

InstallSpec declares one package to install at server startup or programmatically.

func (InstallSpec) Normalize

func (s InstallSpec) Normalize() InstallSpec

Normalize fills derived fields and returns a copy safe to use.

func (InstallSpec) Validate

func (s InstallSpec) Validate() error

Validate checks required fields for one install spec.

type InstallWorker

type InstallWorker struct {
	Installer                  *Installer
	Store                      store.JobStore
	TerminologyInstalls        store.TerminologyInstallStoreFactory
	DefaultTerminologyTenantID string
}

InstallWorker handles registry.package_install jobs.

func (*InstallWorker) HandleJob

func (w *InstallWorker) HandleJob(ctx context.Context, job store.JobRecord) error

HandleJob installs a package from the job payload.

type Installer

type Installer struct {
	Registry     *registry.Manager
	Refresh      func(ctx context.Context) error
	RegistryBase string
	HTTPClient   *http.Client
	TempDir      string
	EnableTypes  bool
	ViewRegistry *view.Registry
	FHIRPath     fhirpath.Engine
	OnProgress   ProgressFunc
}

Installer ingests FHIR NPM packages into the registry catalog.

func (*Installer) InstallFromArchive

func (i *Installer) InstallFromArchive(ctx context.Context, packageID, version string, r io.Reader) (*InstallResult, error)

InstallFromArchive extracts a FHIR NPM tarball and installs package resources.

func (*Installer) InstallFromDirectory

func (i *Installer) InstallFromDirectory(ctx context.Context, dir string) (*InstallResult, error)

InstallFromDirectory installs all JSON definitions from a local directory tree.

func (*Installer) InstallFromDirectoryVersion

func (i *Installer) InstallFromDirectoryVersion(ctx context.Context, dir, packageID, version string) (*InstallResult, error)

InstallFromDirectoryVersion installs a local package tree with explicit id and version.

func (*Installer) InstallFromRegistry

func (i *Installer) InstallFromRegistry(ctx context.Context, packageID, version string) (*InstallResult, error)

InstallFromRegistry downloads and installs a package from packages.fhir.org.

func (*Installer) InstallIfNeeded

func (i *Installer) InstallIfNeeded(ctx context.Context, spec InstallSpec) (*InstallResult, bool, error)

InstallIfNeeded installs one package when that version is not already complete. The returned skipped flag is true when CompletePackageInstall already recorded the version.

type ProgressFunc

type ProgressFunc func(current, total int, message string)

ProgressFunc reports install progress for long-running package installs.

Jump to

Keyboard shortcuts

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