ociinstaller

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: AGPL-3.0 Imports: 34 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultImageTag            = "latest"
	DefaultImageRepoActualURL  = "us-docker.pkg.dev/steampipe"
	DefaultImageRepoDisplayURL = "hub.steampipe.io"

	DefaultImageOrg  = "turbot"
	DefaultImageType = "plugins"
)
View Source
const (
	MediaTypeConfig = "application/vnd.turbot.steampipe.config.v1+json"

	//deprecate this....
	MediaTypePluginConfig = "application/vnd.turbot.steampipe.plugin.config.v1+json"

	MediaTypePluginDarwinAmd64Layer  = "application/vnd.turbot.steampipe.plugin.darwin-amd64.layer.v1+gzip"
	MediaTypePluginLinuxAmd64Layer   = "application/vnd.turbot.steampipe.plugin.linux-amd64.layer.v1+gzip"
	MediaTypePluginWindowsAmd64Layer = "application/vnd.turbot.steampipe.plugin.windows-amd64.layer.v1+gzip"
	MediaTypePluginDarwinArm64Layer  = "application/vnd.turbot.steampipe.plugin.darwin-arm64.layer.v1+gzip"
	MediaTypePluginLinuxArm64Layer   = "application/vnd.turbot.steampipe.plugin.linux-arm64.layer.v1+gzip"
	MediaTypePluginWindowsArm64Layer = "application/vnd.turbot.steampipe.plugin.windows-arm64.layer.v1+gzip"
	MediaTypePluginLicenseLayer      = "application/vnd.turbot.steampipe.plugin.license.layer.v1+text"
	MediaTypePluginDocsLayer         = "application/vnd.turbot.steampipe.plugin.docs.layer.v1+tar"
	MediaTypePluginSpcLayer          = "application/vnd.turbot.steampipe.plugin.spc.layer.v1+tar"

	MediaTypeDbDarwinAmd64Layer  = "application/vnd.turbot.steampipe.db.darwin-amd64.layer.v1+tar"
	MediaTypeDbLinuxAmd64Layer   = "application/vnd.turbot.steampipe.db.linux-amd64.layer.v1+tar"
	MediaTypeDbWindowsAmd64Layer = "application/vnd.turbot.steampipe.db.windows-amd64.layer.v1+tar"
	MediaTypeDbDarwinArm64Layer  = "application/vnd.turbot.steampipe.db.darwin-arm64.layer.v1+tar"
	MediaTypeDbLinuxArm64Layer   = "application/vnd.turbot.steampipe.db.linux-arm64.layer.v1+tar"
	MediaTypeDbWindowsArm64Layer = "application/vnd.turbot.steampipe.db.windows-arm64.layer.v1+tar"
	MediaTypeDbDocLayer          = "application/vnd.turbot.steampipe.db.doc.layer.v1+text"
	MediaTypeDbLicenseLayer      = "application/vnd.turbot.steampipe.db.license.layer.v1+text"

	MediaTypeFdwDarwinAmd64Layer  = "application/vnd.turbot.steampipe.fdw.darwin-amd64.layer.v1+gzip"
	MediaTypeFdwLinuxAmd64Layer   = "application/vnd.turbot.steampipe.fdw.linux-amd64.layer.v1+gzip"
	MediaTypeFdwWindowsAmd64Layer = "application/vnd.turbot.steampipe.fdw.windows-amd64.layer.v1+gzip"
	MediaTypeFdwDarwinArm64Layer  = "application/vnd.turbot.steampipe.fdw.darwin-arm64.layer.v1+gzip"
	MediaTypeFdwLinuxArm64Layer   = "application/vnd.turbot.steampipe.fdw.linux-arm64.layer.v1+gzip"
	MediaTypeFdwWindowsArm64Layer = "application/vnd.turbot.steampipe.fdw.windows-arm64.layer.v1+gzip"
	MediaTypeFdwDocLayer          = "application/vnd.turbot.steampipe.fdw.doc.layer.v1+text"
	MediaTypeFdwLicenseLayer      = "application/vnd.turbot.steampipe.fdw.license.layer.v1+text"

	MediaTypeFdwControlLayer = "application/vnd.turbot.steampipe.fdw.control.layer.v1+text"
	MediaTypeFdwSqlLayer     = "application/vnd.turbot.steampipe.fdw.sql.layer.v1+text"

	MediaTypeAssetReportLayer = "application/vnd.turbot.steampipe.assets.report.layer.v1+tar"
)

Steampipe Media Types

View Source
const DefaultConfigSchema string = "2020-11-18"

Variables

This section is empty.

Functions

func ConfigMediaTypes

func ConfigMediaTypes() []string

ConfigMediaTypes :: returns media types for OCI $config data ( in the config, not a layer)

func InstallAssets

func InstallAssets(ctx context.Context, assetsLocation string) error

InstallAssets installs the Steampipe report server assets

func InstallDB

func InstallDB(ctx context.Context, dblocation string) (string, error)

InstallDB :: Install Postgres files fom OCI image

func InstallFdw

func InstallFdw(ctx context.Context, dbLocation string) (string, error)

InstallFdw installs the Steampipe Postgres foreign data wrapper from an OCI image

func MediaTypeForPlatform

func MediaTypeForPlatform(imageType ImageType) ([]string, error)

MediaTypeForPlatform returns media types for binaries for this OS and architecture and it's fallbacks in order of priority

func NewOciDownloader

func NewOciDownloader() *ociDownloader

NewOciDownloader creates and returns a ociDownloader instance

func NewTempDir

func NewTempDir(parent string) *tempDir

NewTempDir creates a directory under the given parent directory.

func SharedMediaTypes

func SharedMediaTypes(imageType ImageType) []string

SharedMediaTypes returns media types that are NOT specific to the os and arch (readmes, control files, etc)

Types

type AssetsImage

type AssetsImage struct {
	ReportUI string
}

type DbImage

type DbImage struct {
	ArchiveDir  string
	ReadmeFile  string
	LicenseFile string
}

type HubImage

type HubImage struct {
	BinaryFile  string
	ReadmeFile  string
	LicenseFile string
	ControlFile string
	SqlFile     string
}

type ImageType

type ImageType string
const (
	ImageTypeDatabase ImageType = "db"
	ImageTypeFdw      ImageType = "fdw"
	ImageTypeAssets   ImageType = "assets"
	ImageTypePlugin   ImageType = "plugin"
)

type PluginImage

type PluginImage struct {
	BinaryFile         string
	BinaryDigest       string
	BinaryArchitecture string
	DocsDir            string
	ConfigFileDir      string
	LicenseFile        string
}

type PluginInstallOption added in v0.21.0

type PluginInstallOption = func(config *pluginInstallConfig)

func WithSkipConfig added in v0.21.0

func WithSkipConfig(skipConfigFile bool) PluginInstallOption

type SteampipeImage

type SteampipeImage struct {
	OCIDescriptor *ocispec.Descriptor
	ImageRef      *SteampipeImageRef
	Config        *config
	Plugin        *PluginImage
	Database      *DbImage
	Fdw           *HubImage
	Assets        *AssetsImage
	// contains filtered or unexported fields
}

func InstallPlugin

func InstallPlugin(ctx context.Context, imageRef string, sub chan struct{}, opts ...PluginInstallOption) (*SteampipeImage, error)

InstallPlugin installs a plugin from an OCI Image

type SteampipeImageRef

type SteampipeImageRef struct {
	// contains filtered or unexported fields
}

SteampipeImageRef a struct encapsulating a ref to an OCI image

func NewSteampipeImageRef

func NewSteampipeImageRef(ref string) *SteampipeImageRef

NewSteampipeImageRef creates and returns a New SteampipeImageRef

func (*SteampipeImageRef) ActualImageRef

func (r *SteampipeImageRef) ActualImageRef() string

ActualImageRef returns the actual, physical full image ref (us-docker.pkg.dev/steampipe/plugins/turbot/aws:1.0.0)

func (*SteampipeImageRef) DisplayImageRef

func (r *SteampipeImageRef) DisplayImageRef() string

DisplayImageRef returns the "friendly" user-facing full image ref (hub.steampipe.io/plugins/turbot/aws@1.0.0)

func (*SteampipeImageRef) GetFriendlyName added in v0.21.0

func (r *SteampipeImageRef) GetFriendlyName() string

GetFriendlyName returns the minimum friendly name so that the original name can be rebuilt using preset defaults: hub.steampipe.io/plugins/turbot/aws@1.0.0 => aws@1.0.0 hub.steampipe.io/plugins/turbot/aws@latest => aws hub.steampipe.io/plugins/otherOrg/aws@latest => otherOrg/aws hub.steampipe.io/plugins/otherOrg/aws@1.0.0 => otherOrg/aws@1.0.0 differentRegistry.com/otherOrg/aws@latest => differentRegistry.com/otherOrg/aws@latest differentRegistry.com/otherOrg/aws@1.0.0 => differentRegistry.com/otherOrg/aws@1.0.0

func (*SteampipeImageRef) GetOrgNameAndStream

func (r *SteampipeImageRef) GetOrgNameAndStream() (string, string, string)

GetOrgNameAndStream splits the full image reference into (org, name, stream)

func (*SteampipeImageRef) IsFromSteampipeHub added in v0.21.2

func (r *SteampipeImageRef) IsFromSteampipeHub() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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