Documentation
¶
Index ¶
- Constants
- func ParsePath(p string) (name, version string, ok bool)
- func Path(name, version string) string
- func Serves(t repo.PackageType) bool
- func Shard(name string) string
- func ShardFile(name string) string
- func SpecPath(name, version string) string
- func ValidName(v string) bool
- func ValidVersion(v string) bool
- func ValidateSourceArchive(ctx context.Context, body io.ReadSeeker, size int64, ext string) error
- type Archive
- type Handler
- func (Handler) Admit(ctx context.Context, env format.Env, c repo.Config, w format.Write) (format.Write, error)
- func (Handler) Deleted(context.Context, format.Env, repo.Config, []types.Item) error
- func (Handler) Deleting(context.Context, format.Env, repo.Config, 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) Reindex(ctx context.Context, env format.Env, c repo.Config) error
Constants ¶
View Source
const (
MaxArchiveBytes = 64 << 20
)
Variables ¶
This section is empty.
Functions ¶
func Serves ¶
func Serves(t repo.PackageType) bool
func ValidName ¶
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 ValidateSourceArchive ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.