Documentation
¶
Overview ¶
Package bottle provides command and subcommands for manipulating bottles and bottle metadata.
Index ¶
- func CompressionLevelFlags(flags *pflag.FlagSet, action *bottleactions.CompressionLevelOptions)
- func NewBottleCmd(tool *actions.DataTool) *cobra.Command
- func PartSelectorFlags(flags *pflag.FlagSet, action *bottle.PartSelectorOptions)
- type FSUtil
- func (f *FSUtil) AddDir(fPath string) error
- func (f *FSUtil) AddFileOfSize(fPath string, size int64) error
- func (f *FSUtil) AddFileOfSizeDeterministic(fPath string, size int64) error
- func (f *FSUtil) AddFileWithData(fPath string, data []byte) error
- func (f *FSUtil) Close() error
- func (f *FSUtil) Open(name string) (fs.File, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressionLevelFlags ¶
func CompressionLevelFlags(flags *pflag.FlagSet, action *bottleactions.CompressionLevelOptions)
CompressionLevelFlags adds a flag for changing the default compression level for part compression.
func NewBottleCmd ¶
NewBottleCmd is the top level command that aggregates subcommands for interacting with bottles.
func PartSelectorFlags ¶
func PartSelectorFlags(flags *pflag.FlagSet, action *bottle.PartSelectorOptions)
PartSelectorFlags adds flags for part selectors.
Types ¶
type FSUtil ¶
type FSUtil struct {
RootDir string
// contains filtered or unexported fields
}
FSUtil contains common utilities for working with a filesystem. NewFSUtil should be used to create a new instance. Using the struct directly is not recommended as it may not be initialized properly.
func NewFSUtil ¶
NewFSUtil creates a new FSUtil instance. A temporary directory is created with the given prefix. The directory needs to be removed by the caller with the built in `Close` method. Defer `Close` is not recommended as it ignores any errors while closing the complex filesystem.
func NewFSUtilWithSource ¶
NewFSUtilWithSource is identical to NewFSUtil but allows a custom math/rand.Source to be used.
func (*FSUtil) AddFileOfSize ¶
AddFileOfSize creates a file with the given size, filled with random data. fPath is required to be a relative path.
func (*FSUtil) AddFileOfSizeDeterministic ¶
AddFileOfSizeDeterministic creates a file with the given size, filled with deterministic data. fPath is required to be a relative path.
func (*FSUtil) AddFileWithData ¶
AddFileWithData creates a file with the given data. fPath is required to be a relative path.