Documentation ¶
Overview ¶
Copyright 2012 Sergey Cherepanov (https://github.com/cheggaaa)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- type CType
- type Container
- type File
- 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
- type HoleIndex
- 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
- 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
- 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
- type Rounder
- type Space
- type Storage
- 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)
Constants ¶
View Source
const ( ALLOC_REPLACE = 1 ALLOC_APPEND = 2 ALLOC_INSERT = 3 )
View Source
const WILDCARD = "*"
Variables ¶
View Source
var (
ErrConflict = errors.New("Conflict")
)
View Source
var ErrFileExists = errors.New("File exists")
View Source
var ErrFileNotFound = errors.New("File not found")
View Source
var R = Rounder{}
View Source
var Targets = []int{ALLOC_REPLACE, ALLOC_APPEND, ALLOC_INSERT}
Functions ¶
This section is empty.
Types ¶
type Container ¶
type File ¶
type File struct { Hole // inherits Name string Md5 []byte FSize int64 Time time.Time // contains filtered or unexported fields }
func (*File) ContentType ¶
Return content type file or application/octed-stream if can't
type Hole ¶
type Index ¶
type Index struct { Root *Node // contains filtered or unexported fields }
type Rounder ¶
type Rounder struct{}
Click to show internal directories.
Click to hide internal directories.