cocoapods

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: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxArchiveBytes = 64 << 20
)

Variables

This section is empty.

Functions

func ParsePath

func ParsePath(p string) (name, version string, ok bool)

func Path

func Path(name, version string) string

func Serves

func Serves(t repo.PackageType) bool

func Shard

func Shard(name string) string

func ShardFile

func ShardFile(name string) string

func SpecPath

func SpecPath(name, version string) string

func ValidName

func ValidName(v string) bool

CocoaPods' public CDN includes names with punctuation, spaces and Unicode. The protocol treats a pod name as one path segment, so reject only separators and control characters rather than imposing a narrower invented grammar.

func ValidVersion

func ValidVersion(v string) bool

func ValidateSourceArchive

func ValidateSourceArchive(ctx context.Context, body io.ReadSeeker, size int64, ext string) error

ValidateSourceArchive checks an HTTP-sourced pod's complete archive before remote cache publication. Its podspec comes from the CDN, not this archive.

Types

type Archive

type Archive struct {
	Name    string          `json:"name"`
	Version string          `json:"version"`
	Spec    json.RawMessage `json:"spec"`
	SHA256  string          `json:"sha256"`
}

func ReadArchive

func ReadArchive(body io.Reader, size int64, name, version string) (Archive, error)

ReadArchive accepts an actual CocoaPods tar.gz and one JSON podspec at its root. It reads every header and compressed trailer before the version may be indexed. This prevents a corrupt or path-escaping archive from becoming a resolvable package through an otherwise valid podspec.

type Handler

type Handler struct{ generic.Handler }

func (Handler) Admit

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

func (Handler) Deleted

func (Handler) Deleting

func (Handler) Deployed

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

func (Handler) Inspect

func (Handler) Inspect(
	ctx context.Context,
	env format.Env,
	_ repo.Config,
	w format.Write,
) (any, error)

func (Handler) Reindex

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

Jump to

Keyboard shortcuts

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