Documentation
¶
Index ¶
- func InstallConfigured(ctx context.Context, installer *Installer, specs []InstallSpec) error
- type InstallResult
- type InstallSpec
- type InstallWorker
- type Installer
- func (i *Installer) InstallFromArchive(ctx context.Context, packageID, version string, r io.Reader) (*InstallResult, error)
- func (i *Installer) InstallFromDirectory(ctx context.Context, dir string) (*InstallResult, error)
- func (i *Installer) InstallFromDirectoryVersion(ctx context.Context, dir, packageID, version string) (*InstallResult, error)
- func (i *Installer) InstallFromRegistry(ctx context.Context, packageID, version string) (*InstallResult, error)
- func (i *Installer) InstallIfNeeded(ctx context.Context, spec InstallSpec) (*InstallResult, bool, error)
- type ProgressFunc
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.
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 ¶
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 ¶
ProgressFunc reports install progress for long-running package installs.