mosaic

package
v0.0.0-...-7af3d7a Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATE_COMPLETED = "completed"
	STATE_FAILED    = "failed"
	STATE_MISSING   = "missing"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Name        string   `json:"name"`
	Real_size   int      `json:"real_size"`
	Index       int      `json:"int"`
	TargetNames []string `json:"targets"`
	Checksum    string   `json:"checksum"`
	// contains filtered or unexported fields
}

Chunk: it represents a portion of a Kirinuki files

func NewChunk

func NewChunk(index int, name string, opts ...ChunkOption) *Chunk

NewChunk: it creates a new chunk with the index and name

func (*Chunk) GetFilename

func (c *Chunk) GetFilename() string

GetFilename: it returns the filename of chunk's data

type ChunkOption

type ChunkOption func(*Chunk)

func WithFilename

func WithFilename(filename string) ChunkOption

Setting the filename which contain the chunk's data

type Mosaic

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

Mosaic is in charge of providing high level upload/download methods for Kirinuki files, handling the splitting feature

func New

func New(ms *storage.MultiStorage, opts ...MosaicOption) *Mosaic

func (*Mosaic) Download

func (m *Mosaic) Download(chunks []*Chunk) error

func (*Mosaic) Upload

func (m *Mosaic) Upload(chunks []*Chunk) error

type MosaicOption

type MosaicOption func(*Mosaic)

Jump to

Keyboard shortcuts

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