cookbook

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cookbook finds local cookbooks and packs them into tarballs.

What a cookbook is (which files belong to it, what its metadata says) is decided by cinc-api, the same way for every command: see Load.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractArchive

func ExtractArchive(r io.Reader, destDir string) (string, error)

ExtractArchive unpacks a gzipped cookbook tarball read from r into destDir, which should be empty, and returns the path of the single top-level directory the archive creates (Supermarket tarballs are rooted at <cookbook>/...). Extraction is guarded as tarball.Extract describes.

func Load added in v0.26.0

func Load(dir string, skipChefignore bool) (*cinc.LocalCookbook, error)

Load reads the cookbook in dir the way an upload sees it: the files Chef's loader would pick (chefignore applied unless skipChefignore) and its metadata, with the name falling back to the directory's. A metadata.rb that computes its version is refused with a message saying how to fix it, since cinc can't run the Ruby and would otherwise publish the cookbook as 0.0.0.

func Locate

func Locate(name, cookbookPath string) (string, error)

Locate finds a cookbook by name. cookbookPath may be empty, a single path, or a filepath-list of parent directories.

Types

type Archive

type Archive struct {
	Name  string
	Bytes []byte
	// Files lists every entry, rooted at the cookbook name
	// (nginx/recipes/default.rb), in the order they were written.
	Files []string
}

Archive is an in-memory gzip-compressed tarball and its manifest.

func BuildArchive

func BuildArchive(cb *cinc.LocalCookbook, overlay map[string][]byte) (Archive, error)

BuildArchive packs cb's files into a deterministic gzipped tarball rooted at cb.Name/. overlay adds files, or replaces cb's own, by cookbook-relative path (metadata.json, say), without touching the cookbook on disk.

Jump to

Keyboard shortcuts

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