oci

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MediaTypePixiConfig is the media type for pixi config (empty JSON)
	MediaTypePixiConfig = "application/vnd.pixi.config.v1+toml"
	// MediaTypePixiToml is the media type for pixi.toml manifest
	MediaTypePixiToml = "application/vnd.pixi.toml.v1+toml"
	// MediaTypePixiLock is the media type for pixi.lock lockfile
	MediaTypePixiLock = "application/vnd.pixi.lock.v1+yaml"
)

Variables

This section is empty.

Functions

func ChangeRepositoryVisibility

func ChangeRepositoryVisibility(ctx context.Context, host, repoPath, apiToken string, isPublic bool) error

ChangeRepositoryVisibility changes the visibility of a repository on Quay.io. It calls the Quay.io API: POST /api/v1/repository/{repo}/changevisibility

func IsNebiRepository

func IsNebiRepository(ctx context.Context, repoRef string, opts BrowseOptions) bool

IsNebiRepository checks if a repository contains a Nebi OCI image by inspecting the manifest config media type of the first available tag.

func ParseRegistryURL

func ParseRegistryURL(rawURL string) (host, namespace string)

ParseRegistryURL splits a registry URL into its host and optional namespace. For example, "quay.io/nebari" returns host="quay.io", namespace="nebari". A plain host like "quay.io" returns namespace="".

func PublishWorkspace

func PublishWorkspace(ctx context.Context, envPath string, opts PublishOptions) (string, error)

PublishWorkspace publishes pixi.toml and pixi.lock to an OCI registry

Types

type BrowseOptions

type BrowseOptions struct {
	RegistryHost string
	Username     string
	Password     string
}

BrowseOptions contains options for browsing an OCI registry

type PublishOptions

type PublishOptions struct {
	Repository   string   // Full repository path (e.g., "ghcr.io/myorg/myenv")
	Tag          string   // Primary tag for the manifest (e.g., "sha-a1b2c3d4e5f6")
	ExtraTags    []string // Additional tags to apply (e.g., ["latest"])
	Username     string   // Registry username
	Password     string   // Registry password/token
	RegistryHost string   // Registry hostname (e.g., "ghcr.io")
}

PublishOptions contains options for publishing a workspace

type PullResult

type PullResult struct {
	PixiToml string `json:"pixi_toml"`
	PixiLock string `json:"pixi_lock"`
}

PullResult contains the content pulled from a registry tag

func PullEnvironment

func PullEnvironment(ctx context.Context, repoRef, tag string, opts BrowseOptions) (*PullResult, error)

PullEnvironment fetches pixi.toml and pixi.lock content from a registry tag

type RepositoryInfo

type RepositoryInfo struct {
	Name     string `json:"name"`
	IsPublic *bool  `json:"is_public,omitempty"`
}

RepositoryInfo contains information about a repository

func FilterNebiRepositories

func FilterNebiRepositories(ctx context.Context, repos []RepositoryInfo, host string, opts BrowseOptions) []RepositoryInfo

FilterNebiRepositories filters a list of repositories to only include those that contain Nebi OCI images. It checks repositories concurrently with a semaphore.

func ListRepositories

func ListRepositories(ctx context.Context, opts BrowseOptions) ([]RepositoryInfo, error)

ListRepositories queries the /v2/_catalog endpoint for a registry

func ListRepositoriesViaQuayAPI

func ListRepositoriesViaQuayAPI(ctx context.Context, host, namespace, apiToken string) ([]RepositoryInfo, error)

ListRepositoriesViaQuayAPI lists repositories using Quay.io's REST API. This is used as a fallback when the standard /v2/_catalog endpoint is not supported. If an API token is provided, it is sent as a Bearer token to also list private repos. Always includes public=true so public repos are returned regardless of auth.

type TagInfo

type TagInfo struct {
	Name string `json:"name"`
}

TagInfo contains information about a tag

func ListTags

func ListTags(ctx context.Context, repoRef string, opts BrowseOptions) ([]TagInfo, error)

ListTags lists all tags for a given repository reference

Jump to

Keyboard shortcuts

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