Versions in this module Expand all Collapse all v0 v0.4.1 Aug 24, 2022 Changes in this version + const ALLOC_APPEND + const ALLOC_INSERT + const ALLOC_REPLACE + const WILDCARD + var ErrConflict = errors.New("Conflict") + var ErrFileExists = errors.New("File exists") + var ErrFileNotFound = errors.New("File not found") + var R = Rounder + var Targets = []int + type CType string + func (ct *CType) String() string + type Container struct + Created bool + FDump map[int64]*File + FileCount int64 + FileRealSize int64 + FileSize int64 + HDump map[int64]*Hole + Id int64 + Size int64 + func (c *Container) Allocate(f *File, target int) (ok bool) + func (c *Container) Check() (err error) + func (c *Container) Close() (err error) + func (c *Container) Delete(f *File) + func (c *Container) Dump() (err error) + func (c *Container) Init(s *Storage) (err error) + func (c *Container) Print() + type File struct + FSize int64 + Md5 []byte + Name string + Time time.Time + func (f *File) CheckMd5() (err error) + func (f *File) Close() + func (f *File) ContentType() (ctype string) + func (f *File) Delete() + func (f *File) ETag() string + func (f *File) GetReader() *Reader + func (f *File) Init(c *Container) + func (f *File) IsFree() bool + func (f *File) Md5S() string + func (f *File) Open() (err error) + func (f *File) ReadFrom(r io.Reader) (written int64, err error) + func (f *File) WriteAt(b []byte, off int64) (int, error) + type Hole struct + Indx int + Off int64 + func (h *Hole) End() int64 + func (h *Hole) Index() int + func (h *Hole) IsFree() bool + func (h *Hole) Next() Space + func (h *Hole) Offset() int64 + func (h *Hole) Prev() Space + func (h *Hole) SetNext(s Space) + func (h *Hole) SetOffset(o int64) + func (h *Hole) SetPrev(s Space) + func (h *Hole) Size() int64 + type HoleIndex struct + Count int64 + Size int64 + func (hi *HoleIndex) Add(holes ...*Hole) + func (hi *HoleIndex) Create(prev, next Space, offset int64, index int) (h *Hole) + func (hi *HoleIndex) Delete(s *Hole) + func (hi *HoleIndex) Exists(h *Hole) bool + func (hi *HoleIndex) Get(index int) *Hole + func (hi *HoleIndex) GetBiggest(index int) *Hole + func (hi *HoleIndex) Init() + func (hi *HoleIndex) Print() + type Index struct + Root *Node + func (i *Index) Add(file *File) (err error) + func (i *Index) Count() int64 + func (i *Index) Delete(name string) (f *File, ok bool) + func (i *Index) Get(name string) (f *File, ok bool) + func (i *Index) Init() + func (i *Index) List(prefix string, maxnesting int) (names []string, err error) + func (i *Index) Rename(name, newName string) (f *File, err error) + func (i *Index) Version() int64 + type Node struct + Childs map[string]*Node + File *File + func (n *Node) Add(parts []string, f *File, depth int) (err error) + func (n *Node) Delete(parts []string, depth int) (f *File, err error) + func (n *Node) Get(parts []string, depth int) (f *File, err error) + func (n *Node) IsFile() bool + func (n *Node) List(parts []string, depth, nesting int) (files []string, err error) + func (n *Node) Print(prefix string) + type Reader struct + func (s *Reader) Read(p []byte) (n int, err error) + func (s *Reader) ReadAt(p []byte, off int64) (n int, err error) + func (s *Reader) Seek(offset int64, whence int) (ret int64, err error) + func (s *Reader) Size() int64 + func (s *Reader) WriteTo(dst io.Writer) (written int64, err error) + type Rounder struct + func (r Rounder) Index(size int64) int + func (r Rounder) Round(size int64) int64 + func (r Rounder) Size(index int) int64 + type Space interface + End func() int64 + Index func() int + IsFree func() bool + Next func() Space + Offset func() int64 + Prev func() Space + SetNext func(Space) + SetOffset func(int64) + SetPrev func(Space) + Size func() int64 + type Storage struct + Conf *config.Config + Containers map[int64]*Container + Index *Index + LastContainerId int64 + Stats *stats.Stats + func (s *Storage) Add(name string, r io.Reader, size int64) (f *File, err error) + func (s *Storage) Check() (err error) + func (s *Storage) Close() + func (s *Storage) Delete(name string) (ok bool) + func (s *Storage) DeleteChilds(name string) (ok bool) + func (s *Storage) Drop() + func (s *Storage) Dump() + func (s *Storage) Get(name string) (f *File, ok bool) + func (s *Storage) GetStats() *stats.Stats + func (s *Storage) Init(c *config.Config) + func (s *Storage) Open() (err error)