conan

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package conan owns Conan's on-disk revision layout and write policy.

Index

Constants

View Source
const Manifest = "conanmanifest.txt"

Variables

This section is empty.

Functions

func Component

func Component(s string) bool

Component rejects traversal and control characters before a protocol segment can become an item path. Conan references do not contain slashes.

func Files

func Files(
	ctx context.Context,
	st store.Store,
	c repo.Config,
	folder string,
) ([]types.Item, error)

Files walks one storage folder with bounded keyset pagination. The caller must filter by its principal before returning any name or metadata.

func IsNative

func IsNative(ctx context.Context) bool

func Native

func Native(
	ctx context.Context,
) context.Context

Native marks a write that entered through /api/conan. A generic item PUT cannot claim a Conan revision simply by choosing its storage path.

func SafeFile

func SafeFile(name string) bool

SafeFile permits Conan's metadata subfolders but no empty, dot, encoded separator or exceptionally long path component.

func Serves

func Serves(t repo.PackageType) bool

Types

type FilePath

type FilePath struct {
	Ref      Reference
	Package  bool
	ID, PRev string
	File     string
}

FilePath is the item-tree interpretation of a native Conan file URL.

func ParseStored

func ParseStored(path string) (FilePath, bool)

ParseStored recognizes the documented Artifactory conan-default layout: user/name/version/channel/recipe-revision/{export/file or package/id/package-revision/file}. It is deliberately independent of the HTTP route so restore and reindex use the same identity rules.

func (FilePath) Path

func (f FilePath) Path() string

func (FilePath) Root

func (f FilePath) Root() string

type Handler

type Handler struct{ generic.Handler }

Handler keeps the common package index tied to committed Conan manifests. Files uploaded before a manifest are invisible to search and resolution; the Conan client uploads the manifest last for each revision.

func (Handler) Admit

func (h Handler) Admit(
	ctx context.Context, env format.Env, c repo.Config, w format.Write,
) (format.Write, error)

func (Handler) Deleted

func (h Handler) Deleted(
	ctx context.Context, env format.Env, c repo.Config, removed []types.Item,
) error

func (Handler) Deleting

func (Handler) Deployed

func (h Handler) Deployed(ctx context.Context, env format.Env, c repo.Config, it types.Item) error

func (Handler) Reindex

func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error

type Reference

type Reference struct {
	Name, Version, User, Channel, Revision string
}

Reference is the Conan identity of a recipe. Missing user and channel are represented by underscores on the wire, as the Conan client does.

func (Reference) IsValid

func (r Reference) IsValid() bool

func (Reference) PackageRoot

func (r Reference) PackageRoot(id, revision string) string

func (Reference) RecipeRoot

func (r Reference) RecipeRoot() string

func (Reference) Root

func (r Reference) Root() string

Jump to

Keyboard shortcuts

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