Documentation ¶
Overview ¶
Package mindpak abstracts to bundle profiles and rule types together in an artifact that allows for easy distribution and upgrade.
Package mindpak abstracts to bundle profiles and rule types together in an artifact that allows for easy distribution and upgrade.
Index ¶
Constants ¶
const ( // PathProfiles is the name of the directory holding the profiles of a bundle PathProfiles = "profiles" // PathRuleTypes is the name of the directory holding the rule types of a bundle PathRuleTypes = "rule_types" // ManifestFileName is the defaul filename for the manifest ManifestFileName = "manifest.json" )
const ( // SHA256 is the algorith name constant for the manifest and tests SHA256 = HashAlgorithm("sha-256") )
Variables ¶
var ( // ValidNameRegex is used to check a bundle name or namespace ValidNameRegex = regexp.MustCompile(`^[a-zA-Z0-9](?:[-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?$`) )
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
Bundle abstracts the bundle data.
The bundle has a manifest. The manifest is composed by reading the Source filesystem and categorizing its entries.
func NewBundleFromDirectory ¶
NewBundleFromDirectory reads a directory from a directory and returns a bundle loaded with its contents. The bundle will have its Source filesystem bound to the directory via an os.DirFS.
func NewBundleFromTarGZ ¶
NewBundleFromTarGZ loads a bundle from a .tar.gz file containing the bundle structure. Note that this implementation loads the entire contents of the bundle into memory. This is tested by the test in the `internal/marketplace` package.
func (*Bundle) ReadSource ¶
ReadSource loads the data from the mindpak source filesystem
func (*Bundle) UpdateManifest ¶
UpdateManifest updates the bundle manifest to reflect the bundle data source
type BundleID ¶
BundleID groups together the pieces of information needed to identify a bundle. This cleans up the interfaces which deal with bundles.
type File ¶
type File struct { Name string `json:"name,omitempty"` Hashes map[HashAlgorithm]string `json:"hashes,omitempty"` }
File captures the name and hashes of a file included in the bundle
type Files ¶
type Files struct { Profiles []*File `json:"profiles,omitempty"` RuleTypes []*File `json:"ruleTypes,omitempty"` }
Files is a collection of the files included in the bundle organized by type
type HashAlgorithm ¶
type HashAlgorithm string
HashAlgorithm is a label that indicates a hashing algorithm
Directories ¶
Path | Synopsis |
---|---|
Package build implements tools and function to build mindpaks.
|
Package build implements tools and function to build mindpaks. |
Package reader contains logic for accessing the contents of a bundle
|
Package reader contains logic for accessing the contents of a bundle |
Package sources contains logic for loading a bundle from a source of bundles
|
Package sources contains logic for loading a bundle from a source of bundles |