Documentation
¶
Index ¶
- Constants
- Variables
- func CompareVersion(a, b string) int
- func EncodeIndex(in []Package, feed string) (map[string][]byte, error)
- func Feed(p string) (string, bool)
- func IndexPath(p string) (feed, name string, ok bool)
- func IsPackage(p string) bool
- func LegacyArchiveTarget(p string) (string, bool)
- func PackagePath(p string) (feed, name, version string, ok bool)
- func Serves(t repo.PackageType) bool
- func ValidName(name string) bool
- func ValidVersion(version string) bool
- type Handler
- func (Handler) Admit(ctx context.Context, env format.Env, c repo.Config, w format.Write) (format.Write, error)
- func (Handler) Classify(_ repo.Config, p string) format.Class
- func (Handler) Deleted(ctx context.Context, env format.Env, c repo.Config, removed []types.Item) error
- func (Handler) Deleting(ctx context.Context, env format.Env, c repo.Config, it types.Item) error
- func (Handler) Deployed(ctx context.Context, env format.Env, c repo.Config, it types.Item) error
- func (Handler) Inspect(ctx context.Context, env format.Env, _ repo.Config, w format.Write) (any, error)
- func (Handler) Owed(c repo.Config, cached bool, p string) []format.WorkRef
- func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error
- func (Handler) Work(ctx context.Context, env format.Env, work types.WorkItem) error
- func (Handler) WorkKinds() []string
- type Package
Constants ¶
const ( KindIndex = "cran.index" PropName = "cran.name" PropVersion = "cran.version" PropFeed = "cran.feed" )
const ( PackagesName = "PACKAGES" PackagesGzipName = "PACKAGES.gz" )
Variables ¶
var ErrPackage = errors.New("cran: invalid cran package")
Functions ¶
func CompareVersion ¶
CompareVersion follows R's numeric component ordering for version labels; separators divide components and numeric chunks compare by value.
func EncodeIndex ¶
EncodeIndex records only the newest version per package, as a CRAN client expects from a terminal PACKAGES directory. Older files remain addressable.
func LegacyArchiveTarget ¶
LegacyArchiveTarget recognizes the source archive layout used by older Artifactory releases. The package and version directories must agree with the filename; unrelated paths and canonical archives are left alone.
func PackagePath ¶
PackagePath admits only paths from which a native R client can install.
func Serves ¶
func Serves(t repo.PackageType) bool
func ValidVersion ¶
Types ¶
type Handler ¶
type Package ¶
type Package struct {
Name, Version, Path, Feed string
Fields map[string]string
Size int64
MD5, SHA256 string
}
func ReadPackage ¶
ReadPackage checks the entire archive, including trailing CRCs, before its DESCRIPTION is allowed to enter an index.
func ReadUploaded ¶
func ReadUploaded( ctx context.Context, r io.ReadSeeker, size int64, feed, suffix string, ) (Package, error)
ReadUploaded infers the package identity from an archive whose POST URL supplies the feed but has no filename. The content still goes through the same complete archive validator as a direct path upload.