capture

package
v0.0.0-...-a88d3f6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 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 capture takes a backup of a Chef Infra Server compatible server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromAPI

func FromAPI(ctx context.Context, c *cinc.Client, w *format.Writer, opts Options) error

FromAPI crawls the whole server through c and writes every object it finds to w, exactly as the server returned it. c must sign as a superuser; its Config.Org is not used. An object that disappears between being listed and being read is skipped with a warning; any other failure stops the backup.

func RedirectPolicy

func RedirectPolicy(serverURL string, opts Options) func(*http.Request, []*http.Request) error

RedirectPolicy returns an http.Client CheckRedirect that applies FromAPI's file-host rules to every redirect hop, so an allowed host cannot send a cookbook file fetch elsewhere. Install it on the client passed to FromAPI: cinc-api follows redirects for file transfers (S3 redirects across regions) and never for signed requests.

Types

type Options

type Options struct {
	// Concurrency bounds the requests in flight. Zero means 8.
	Concurrency int
	// BlobHosts lists extra hosts (host or host:port) cookbook files may be
	// fetched from, such as the S3 endpoint of an external bookshelf. Files
	// on the server's own host are always allowed; any other URL in a
	// manifest is refused.
	BlobHosts []string
}

Options tune a backup.

Jump to

Keyboard shortcuts

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