suitcase

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package suitcase holds all the stuff necessary for a suitecase generation

Index

Constants

View Source
const (
	// NullFormat is the unset value for this type
	NullFormat = iota
	// TarFormat is for tar
	TarFormat
	// TarGzFormat is for tar.gz
	TarGzFormat
	// TarGzGpgFormat is for encrypted tar.gz (tar.gz.gpg)
	TarGzGpgFormat
	// TarGpgFormat is for encrypted tar.gz (tar.gpg)
	TarGpgFormat
	// TarZstFormat uses the zstd compression engine (tar.zst)
	TarZstFormat
	// TarZstGpgFormat uses the zstd compression engine with Gpg (tar.zst.gpg)
	TarZstGpgFormat
)

Variables

This section is empty.

Functions

func FillWithInventoryIndex

func FillWithInventoryIndex(s Suitcase, i *inventory.Inventory, index int, stateC chan FillState) ([]config.HashSet, error)

FillWithInventoryIndex fills up a suitcase using the given inventory

func FormatCompletion added in v0.11.0

func FormatCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

FormatCompletion returns shell completion

func OptsWithCmd added in v0.13.0

func OptsWithCmd(cmd *cobra.Command) *config.SuitCaseOpts

OptsWithCmd returns suitcase options givena cobra command

func PostProcess

func PostProcess(s Suitcase) error

PostProcess executes post processing commands

func WriteHashFile added in v0.12.0

func WriteHashFile(hs []config.HashSet, o io.Writer) error

WriteHashFile writes out the hashset array to an io.Writer

func WriteSuitcaseFile

func WriteSuitcaseFile(so *config.SuitCaseOpts, i *inventory.Inventory, index int, stateC chan FillState) (string, error)

WriteSuitcaseFile will write out the suitcase

Types

type FillState

type FillState struct {
	Current        uint
	Total          uint
	Completed      bool
	CurrentPercent float64
	Index          int
}

FillState is the current state of a suitcase file

type Format added in v0.11.0

type Format int

Format is the format the inventory will use, such as yaml, json, etc

func (*Format) MarshalJSON added in v0.11.0

func (f *Format) MarshalJSON() ([]byte, error)

MarshalJSON ensures that json conversions use the string value here, not the int value

func (*Format) Set added in v0.11.0

func (f *Format) Set(v string) error

Set helps fulfill the pflag.Value interface

func (Format) String added in v0.11.0

func (f Format) String() string

func (Format) Type added in v0.11.0

func (f Format) Type() string

Type satisfies part of the pflags.Value interface

type Suitcase

type Suitcase interface {
	Close() error
	Add(inventory.File) (*config.HashSet, error)
	AddEncrypt(f inventory.File) error
	Config() *config.SuitCaseOpts
}

Suitcase is the interface that describes what a Suitcase does

func New

func New(w io.Writer, opts *config.SuitCaseOpts) (Suitcase, error)

New Create a new suitcase

Directories

Path Synopsis
Package tar provides simple tar suitcases
Package tar provides simple tar suitcases
Package tarbz2 creates tar.bz2 files
Package tarbz2 creates tar.bz2 files
Package targpg works the tar.gpg suitcases
Package targpg works the tar.gpg suitcases
Package targz creates tar.gz files
Package targz creates tar.gz files
Package targzgpg provides gpg encrypted tar.gz suitcases
Package targzgpg provides gpg encrypted tar.gz suitcases
Package tarzstd creates tar.zst files
Package tarzstd creates tar.zst files
Package tarzstgpg provides gpg encrypted tar.zst suitcases
Package tarzstgpg provides gpg encrypted tar.zst suitcases

Jump to

Keyboard shortcuts

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