uploads

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	io.Reader
	Path    string
	Hash    string
	Mode    fs.FileMode
	Size    int64
	ModTime time.Time
}

type Upload

type Upload struct {
	MaxPackSize  int
	MinChunkSize int
	MaxChunkSize int
	Limiter      rate.Limiter
	Concurrency  int
	// contains filtered or unexported fields
}

func New

func New(log *slog.Logger, uploadCh chan<- *repos.File) *Upload

func (*Upload) Add

func (u *Upload) Add(ctx context.Context, file *File) (packId string, err error)

func (*Upload) Flush

func (u *Upload) Flush(ctx context.Context) error

Jump to

Keyboard shortcuts

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