oci

package
v0.0.0-...-30fe120 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package oci implements all the interactions with remote registry.

Index

Constants

View Source
const (

	// FalcoRulesfileConfigMediaType is the MediaType for rule's config layer.
	FalcoRulesfileConfigMediaType = "application/vnd.cncf.falco.rulesfile.config.v1+json"

	// FalcoRulesfileLayerMediaType is the MediaType for rules.
	FalcoRulesfileLayerMediaType = "application/vnd.cncf.falco.rulesfile.layer.v1+tar.gz"

	// FalcoPluginConfigMediaType is the MediaType for plugin's config layer.
	FalcoPluginConfigMediaType = "application/vnd.cncf.falco.plugin.config.v1+json"

	// FalcoPluginLayerMediaType is the MediaType for plugins.
	FalcoPluginLayerMediaType = "application/vnd.cncf.falco.plugin.layer.v1+tar.gz"

	// DefaultRegistry is the default container registry to use.
	DefaultRegistry = "ghcr.io"

	// DefaultTag is the default tag reference to be used when none is provided.
	DefaultTag = "latest"
)

Variables

This section is empty.

Functions

func Platforms

func Platforms(ctx context.Context, ref string, client *auth.Client) (map[string]struct{}, error)

Platforms returns a list of all available platforms for a given ref.

func Tags

func Tags(ctx context.Context, ref string, client *auth.Client) ([]string, error)

Tags returns the list of all available tags of an artifact given a reference to a repository.

Types

type ArtifactConfig

type ArtifactConfig struct {
	Dependencies []ArtifactDependency `json:"dependencies,omitempty"`
}

ArtifactConfig is the struct stored in the config layer of rulesfile and plugin artifacts. Each type fills only the fields of interest.

func (*ArtifactConfig) ParseDependencies

func (rc *ArtifactConfig) ParseDependencies(dependencies ...string) error

ParseDependencies parses artifact dependencies in the format "name:version|alt1:version1|..." and set them in the config.

func (*ArtifactConfig) SetDepedency

func (rc *ArtifactConfig) SetDepedency(name, version string) int

SetDepedency stores an artifact dependency in the config.

Return the insertion position.

type ArtifactDependency

type ArtifactDependency struct {
	Name         string       `json:"name"`
	Version      string       `json:"version"`
	Alternatives []dependency `json:"alternatives,omitempty"`
}

ArtifactDependency represents the artifact's depedendency to be stored in the config.

func (*ArtifactDependency) SetAlternative

func (a *ArtifactDependency) SetAlternative(name, version string)

SetAlternative sets an alternative dependency for an artifact dependency.

type ArtifactType

type ArtifactType string

ArtifactType represents a rules file or a plugin. Used to select the right mediaType when interacting with the registry.

const (
	// Rulesfile represents a rules file artifact.
	Rulesfile ArtifactType = "rulesfile"
	// Plugin represents a plugin artifact.
	Plugin ArtifactType = "plugin"
)

func (*ArtifactType) Set

func (e *ArtifactType) Set(v string) error

Set an ArtifactType.

func (*ArtifactType) String

func (e *ArtifactType) String() string

String returns a string representation of ArtifactType.

func (*ArtifactType) Type

func (e *ArtifactType) Type() string

Type returns a string representing this type.

type RegistryResult

type RegistryResult struct {
	Digest   string
	Config   ArtifactConfig
	Type     ArtifactType
	Filename string
}

RegistryResult represents a generic result that is generated when interacting with a remote OCI registry.

Directories

Path Synopsis
Package authn implements the logic for authentication with OCI registries.
Package authn implements the logic for authentication with OCI registries.
Package puller implements the logic for pull operations.
Package puller implements the logic for pull operations.
Package pusher implements the logic for push operations.
Package pusher implements the logic for push operations.

Jump to

Keyboard shortcuts

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