raifs

package module
v0.0.0-...-63a5655 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2018 License: MIT Imports: 6 Imported by: 0

README

raifs

Redundant Array Of Independent File-Systems.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ECOR = fmt.Errorf("raifs.ECOR")

Functions

func Encode

func Encode(s *Storage, u *uuid.UUID, data []byte, name, mime string) error

func Fill

func Fill(shards [][]byte)

func Pull

func Pull(shard []byte) (rest []byte, err error)

func Split

func Split(n, p int, data []byte, name, mime string) (shards [][]byte)

Types

type Decoder

type Decoder struct {
	St *Storage
	U  *uuid.UUID
	// contains filtered or unexported fields
}

func (*Decoder) Look

func (d *Decoder) Look() error

func (*Decoder) Read

func (d *Decoder) Read(buf []byte) (n int, err error)
type Header struct {
	Name    string
	Mime    string
	Offset  int64
	Length  int64 // Length of this shard.
	Shard   int
	Nshards int
	Pshards int
}

func Peek

func Peek(shard []byte) (hdr Header, err error)

type Storage

type Storage struct {
	Pathes    []string
	Data, Par int
}

func (*Storage) Len

func (s *Storage) Len() int

func (*Storage) NumShards

func (s *Storage) NumShards(min int) (data, par int)

func (*Storage) SetRedundancy

func (s *Storage) SetRedundancy(i int)

func (*Storage) Shard

func (s *Storage) Shard(u *uuid.UUID, i int) string

Jump to

Keyboard shortcuts

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