Documentation ¶
Index ¶
- Variables
- func CopyHeader(h *tar.Header) *tar.Header
- type Path
- func (p *Path) Bucket() string
- func (p *Path) Dup(bucket string) *Path
- func (p *Path) Filename() string
- func (p *Path) Object() string
- func (p *Path) Reader(ctx context.Context, client *storage.Client) (*storage.Reader, error)
- func (p *Path) Writer(ctx context.Context, client *storage.Client) *storage.Writer
- type Source
- type Target
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotRegularFile = errors.New("file type is not regular")
)
Functions ¶
Types ¶
type Path ¶
Path represents a parsed URL to an object in GCS or local file.
func ParseArchiveURL ¶
ParseArchiveURL parses a gs:// or file:// path of a .tgz archive.
type Source ¶
type Source struct { // Path is the original archive URL. Path *Path // Count is the number of files read from the archive. Count int // Size is the number of bytes in the archive. Size int io.Closer // contains filtered or unexported fields }
Source reads from a tar archive from Path containing test files.
func NewFileSource ¶
NewFileSource creates a new Source for the named file. The file parameter should be a URL, like file:///path/to/filename.tgz
func NewGCSSource ¶
NewGCSSource creates a new Source from the given GCS object. The url parameter should be a GCS URL, like gs://bucket/path/to/filename.tgz
type Target ¶
type Target struct { // Count is the number of files written to the archive. Count int // contains filtered or unexported fields }
A Target represents a single, compressed, tar archive containing files to be uploaded to GCS.
func NewTarget ¶
func NewTarget() *Target
NewTarget creates a new Target for adding files to a compressed tar archive.
Click to show internal directories.
Click to hide internal directories.