Documentation
¶
Overview ¶
Package puppet validates Puppet module archives and maintains their native index.
Index ¶
- Constants
- Variables
- func ParsePath(p string) (name, version string, ok bool)
- func Path(name, version string) string
- func Serves(t repo.PackageType) bool
- func ValidName(name string) bool
- func ValidVersion(version string) bool
- func ValidateManifest(m Manifest) bool
- type Dependency
- 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
- type Manifest
- type Metadata
Constants ¶
View Source
const ( MaxArchiveBytes = 64 << 20 MaxUnpackedBytes = 128 << 20 MaxManifestBytes = 1 << 20 MaxFiles = 4096 )
View Source
const ( PropName = "puppet.name" PropVersion = "puppet.version" PropSHA256 = "puppet.sha256" )
Variables ¶
View Source
var (
ErrArchive = errors.New("puppet: invalid module archive")
)
Functions ¶
func Serves ¶
func Serves(t repo.PackageType) bool
func ValidVersion ¶
func ValidateManifest ¶
ValidateManifest rejects invalid identities and dependency constraints before metadata can enter the native index. Puppet resolves the validated constraints.
Types ¶
type Dependency ¶
type Dependency struct {
Name string `json:"name"`
VersionRequirement string `json:"version_requirement"`
}
func (*Dependency) UnmarshalJSON ¶
func (d *Dependency) UnmarshalJSON(data []byte) error
type Handler ¶
type Manifest ¶
type Manifest struct {
Name string `json:"name"`
Version string `json:"version"`
Author string `json:"author,omitempty"`
Summary string `json:"summary,omitempty"`
License string `json:"license,omitempty"`
Source string `json:"source,omitempty"`
Dependencies []Dependency `json:"dependencies"`
}
Manifest is the client-visible, validated module identity and dependencies.
func (*Manifest) UnmarshalJSON ¶
UnmarshalJSON rejects duplicate identity/dependency fields, including case aliases, so the archive and a client's JSON parser cannot disagree.
Click to show internal directories.
Click to hide internal directories.