push

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePackJob

func CreatePackJob(
	ctx context.Context,
	db *gorm.DB,
	attachmentID model.SourceAttachmentID,
	fileRangeIDs []model.FileRangeID,
) (*model.Job, error)

func EnsureParentDirectories

func EnsureParentDirectories(
	ctx context.Context,
	db *gorm.DB,
	file *model.File, rootDirID model.DirectoryID,
	directoryCache map[string]model.DirectoryID) error

func ExtractFromFsObject

func ExtractFromFsObject(ctx context.Context, info fs.ObjectInfo) (size int64, hashValue string, lastModified time.Time)

func MaxSizeToSplitSize

func MaxSizeToSplitSize(m int64) int64

func PushFile

func PushFile(
	ctx context.Context,
	db *gorm.DB,
	obj fs.ObjectInfo,
	attachment model.SourceAttachment,
	directoryCache map[string]model.DirectoryID) (*model.File, []model.FileRange, error)

Types

type FileRangeSet

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

func NewFileRangeSet

func NewFileRangeSet() *FileRangeSet

func (*FileRangeSet) Add

func (r *FileRangeSet) Add(fileRanges ...model.FileRange)

func (*FileRangeSet) AddIfFits

func (r *FileRangeSet) AddIfFits(fileRange model.FileRange, maxSize int64) bool

func (*FileRangeSet) CarSize

func (r *FileRangeSet) CarSize() int64

func (*FileRangeSet) FileRangeIDs

func (r *FileRangeSet) FileRangeIDs() []model.FileRangeID

func (*FileRangeSet) FileRanges

func (r *FileRangeSet) FileRanges() []model.FileRange

func (*FileRangeSet) Reset

func (r *FileRangeSet) Reset()

Jump to

Keyboard shortcuts

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