Documentation
¶
Index ¶
- func ExtractCheckpoint(ctx context.Context, from *flate.Checkpoint, bs BlobSeeker, start, end int64) (io.ReadCloser, error)
- func ExtractFile(ctx context.Context, t Index, bs BlobSeeker, tf *TOCFile) (io.ReadCloser, error)
- func Peek(rc io.ReadCloser) (string, io.ReadCloser, io.ReadCloser, error)
- func TarHeader(header *TOCFile) *tar.Header
- type BlobSeeker
- type Checkpoint
- type Checkpointer
- type Index
- type Indexer
- type MultiFS
- type PeekReader
- type RenderDir
- type RenderFunc
- type SociFS
- type TOC
- type TOCFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractCheckpoint ¶
func ExtractCheckpoint(ctx context.Context, from *flate.Checkpoint, bs BlobSeeker, start, end int64) (io.ReadCloser, error)
func ExtractFile ¶
func ExtractFile(ctx context.Context, t Index, bs BlobSeeker, tf *TOCFile) (io.ReadCloser, error)
func Peek ¶
func Peek(rc io.ReadCloser) (string, io.ReadCloser, io.ReadCloser, error)
Peek detects streams of: tar tar+gzip tar+zstd gzip zstd
Types ¶
type BlobSeeker ¶
type Checkpoint ¶
type Checkpointer ¶
type Checkpointer struct {
Checkpoint *flate.Checkpoint
File *TOCFile
Discard int64
// contains filtered or unexported fields
}
type Index ¶
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
func NewIndexer ¶
func NewIndexer(rc io.ReadCloser, w io.Writer, span int64, mediaType string) (*Indexer, string, io.ReadCloser, io.ReadCloser, error)
Returns: Indexer (if non-nil, everything else is nil) Original stream (buffered rc to Peek) Unwrapped stream (ungzip or unzstd, nil if we could not unwrap or err != nil) Error (maybe nil)
type RenderFunc ¶
type SociFS ¶
type SociFS struct {
// contains filtered or unexported fields
}
type TOC ¶
type TOC struct {
// TODO: Move these so files/checkpoints can be streamingly parsed.
// metadata.json?
Csize int64 `json:"csize,omitempty"`
Usize int64 `json:"usize,omitempty"`
Ssize int64 `json:"ssize,omitempty"`
ArchiveSize int64 `json:"asize,omitempty"`
Size int64 `json:"size,omitempty"`
Type string `json:"type,omitempty"`
MediaType string `json:"mediaType,omitempty"`
// TODO: Checkpoints as jsonlines in separate file.
Checkpoints []*flate.Checkpoint `json:"checkpoints,omitempty"`
// TODO: Files as jsonlines in separate file.
Files []TOCFile `json:"files,omitempty"`
}
func (*TOC) Checkpoint ¶
func (toc *TOC) Checkpoint(tf *TOCFile) *Checkpointer
type TOCFile ¶
type TOCFile struct {
// The tar stuff we actually care about.
// TODO: Just include all of it, for completeness?
Typeflag byte `json:"typeflag,omitempty"`
Name string `json:"name,omitempty"`
Linkname string `json:"linkname,omitempty"`
Size int64 `json:"size,omitempty"`
Mode int64 `json:"mode,omitempty"`
ModTime time.Time `json:"mod,omitempty"`
Uid int `json:"uid,omitempty"`
Gid int `json:"gid,omitempty"`
PAXRecords map[string]string `json:"pax,omitempty"`
// Our uncompressed offset so we can seek ahead.
Offset int64 `json:"offset,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.