Documentation
¶
Overview ¶
Package chef validates Chef cookbook archives and maintains their native index.
Index ¶
- Constants
- Variables
- func IsMetadata(path string) bool
- func ParsePath(p string) (name, version string, ok bool)
- func Path(name, version string) string
- func Serves(t repo.PackageType) bool
- func UniqueFields(data []byte, known ...string) error
- func ValidName(name string) bool
- func ValidVersion(version string) bool
- func ValidateManifest(m Manifest) bool
- 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) GuardTransferSource(_ context.Context, _ format.Env, _ 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 = "chef.name" PropVersion = "chef.version" PropSHA256 = "chef.sha256" )
Variables ¶
View Source
var (
ErrArchive = errors.New("chef: invalid cookbook archive")
)
Functions ¶
func IsMetadata ¶
func Serves ¶
func Serves(t repo.PackageType) bool
func UniqueFields ¶
func ValidVersion ¶
func ValidateManifest ¶
Types ¶
type Handler ¶
func (Handler) GuardTransferSource ¶
func (Handler) GuardTransferSource( _ context.Context, _ format.Env, _ repo.Config, it types.Item, ) error
GuardTransferSource keeps unfiltered remote catalog metadata behind the native permission-aware API when a caller copies, moves or reuses content.
type Manifest ¶
type Manifest struct {
Name string `json:"name"`
Version string `json:"version"`
Maintainer string `json:"maintainer,omitempty"`
Description string `json:"description,omitempty"`
License string `json:"license,omitempty"`
SourceURL string `json:"source_url,omitempty"`
Dependencies map[string]string `json:"dependencies"`
Platforms map[string]string `json:"platforms"`
}
Manifest is the client-visible, validated cookbook identity and dependencies.
func (*Manifest) UnmarshalJSON ¶
UnmarshalJSON refuses duplicate or case-aliased keys before the cookbook identity and dependency maps reach a native client with different JSON rules.
Click to show internal directories.
Click to hide internal directories.