Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Zip = compressor{ ContentType: "application/zip", Ext: ".zip", Compress: func(ctx context.Context, dst io.Writer, root string) (err error) { z := zipper.New() z.ProgressReporter, err = zipper.NewProgressBarReporter(ctx, root, nil) if err == nil { err = z.CompressDir(ctx, root, dst, false) } return }, } XZ = compressor{ ContentType: "application/x-xz", Ext: ".tar.xz", Compress: func(ctx context.Context, dst io.Writer, root string) error { base := filepath.Base(root) _, size, err := zipper.CountDirContents(ctx, root) if err != nil { return err } bar := internal.DefaultBytes(size, "compressing") xzw, err := xz.NewWriter(dst) if err != nil { return err } tw := tar.NewWriter(xzw) if err = zipper.WalkRegularFiles(ctx, root, func(path string, d fs.DirEntry) error { fi, err := d.Info() if err != nil { return err } src, err := os.Open(path) if err != nil { return err } defer src.Close() if path, err = filepath.Rel(root, path); err != nil { return err } if err = tw.WriteHeader(&tar.Header{ Name: filepath.Join(base, path), Size: fi.Size(), Mode: 0600, }); err == nil { err = internal.CopyWithContext(ctx, io.MultiWriter(tw, bar), src) } return err }); err != nil { return err } if err = tw.Close(); err == nil { err = xzw.Close() } return err }, } )
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { Bucket string `short:"b" long:"bucket" description:"name of the S3 bucket containing the files" required:"true"` Prefix string `short:"k" long:"key-prefix" description:"key prefix to apply to all S3 operations"` ExpectedBucketOwner *string `long:"expected-bucket-owner" description:"optional ExpectedBucketOwner field to apply to all S3 operations"` Delete bool `` /* 208-byte string literal not displayed */ XZ bool `long:"xz" description:"if given, local directories will be tar-ed and compressed instead of using zip by default"` MaxConcurrency int `` /* 137-byte string literal not displayed */ Args struct { Files []flags.Filename `` /* 222-byte string literal not displayed */ } `positional-args:"yes"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.