filesegment

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const FilenameAnnotationKey = "filename"
View Source
const MediaType = types.MediaType("application/online.jarosik.tomasz.geranos.segment")
View Source
const RangeAnnotationKey = "range"

Variables

This section is empty.

Functions

func Matches

func Matches(d *Descriptor, dir string, opt ...LayerOpt) bool

func NewWriter

func NewWriter(dir string, d *Descriptor) (*os.File, error)

Types

type Descriptor

type Descriptor struct {
	// contains filtered or unexported fields
}

func NewDescriptor

func NewDescriptor(filename string, start, stop int64, digest v1.Hash) *Descriptor

func ParseDescriptor

func ParseDescriptor(d v1.Descriptor, diffID v1.Hash) (*Descriptor, error)

func (*Descriptor) Annotations

func (d *Descriptor) Annotations() map[string]string

func (*Descriptor) DiffID added in v0.7.5

func (d *Descriptor) DiffID() v1.Hash

func (*Descriptor) Digest

func (d *Descriptor) Digest() v1.Hash

func (*Descriptor) Filename

func (d *Descriptor) Filename() string

func (*Descriptor) Length

func (d *Descriptor) Length() int64

func (*Descriptor) MediaType

func (d *Descriptor) MediaType() types.MediaType

func (*Descriptor) Start

func (d *Descriptor) Start() int64

func (*Descriptor) Stop

func (d *Descriptor) Stop() int64

func (*Descriptor) String

func (d *Descriptor) String() string

type Layer

type Layer struct {
	// contains filtered or unexported fields
}

func NewLayer

func NewLayer(filePath string, opts ...LayerOpt) (*Layer, error)

func Split

func Split(fullpath string, chunkSize int64, opt ...LayerOpt) ([]*Layer, error)

func (*Layer) Annotations

func (pfl *Layer) Annotations() map[string]string

func (*Layer) Compressed

func (pfl *Layer) Compressed() (io.ReadCloser, error)

Compressed implements v1.Layer

func (*Layer) DiffID

func (pfl *Layer) DiffID() (v1.Hash, error)

func (*Layer) Digest

func (pfl *Layer) Digest() (v1.Hash, error)

Digest implements v1.Layer

func (*Layer) Length

func (pfl *Layer) Length() int64

func (*Layer) MediaType

func (pfl *Layer) MediaType() (types.MediaType, error)

func (*Layer) Size

func (pfl *Layer) Size() (int64, error)

func (*Layer) Start

func (pfl *Layer) Start() int64

func (*Layer) Stop

func (pfl *Layer) Stop() int64

func (*Layer) String

func (pfl *Layer) String() string

func (*Layer) Uncompressed

func (pfl *Layer) Uncompressed() (io.ReadCloser, error)

Uncompressed implements v1.Layer

type LayerOpt

type LayerOpt func(*Layer)

func WithLogFunction

func WithLogFunction(log func(fmt string, args ...any)) LayerOpt

func WithRange

func WithRange(start, stop int64) LayerOpt

Jump to

Keyboard shortcuts

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