Documentation ¶
Index ¶
- func HashPath(dir string, hash string) string
- func ReadHexDatabase(d string) map[string]bool
- type Client
- type HashWriter
- type LruCache
- type Request
- type Response
- type ServeSplice
- type Server
- type Store
- func (st *Store) AddTiming(name string, bytes int, dt time.Duration)
- func (st *Store) DestructiveSavePath(path string) (hash string, err error)
- func (st *Store) Has(hash string) bool
- func (st *Store) HashType() crypto.Hash
- func (store *Store) NewClient(conn io.ReadWriteCloser) *Client
- func (store *Store) NewHashWriter() *HashWriter
- func (st *Store) Path(hash string) string
- func (st *Store) Save(content []byte) (hash string)
- func (st *Store) SavePath(path string) (hash string)
- func (st *Store) SaveStream(input io.Reader, size int64) (hash string)
- func (st *Store) ServeChunk(req *Request, rep *Response) (err error)
- func (c *Store) ServeConn(conn io.ReadWriteCloser)
- func (st *Store) ThroughputStats() []stats.Sample
- type StoreOptions
- type ThroughputSample
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadHexDatabase ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a thread-safe interface to fetching over a connection.
type HashWriter ¶
type HashWriter struct {
// contains filtered or unexported fields
}
func (*HashWriter) Close ¶
func (st *HashWriter) Close() error
func (*HashWriter) Sum ¶
func (st *HashWriter) Sum() string
func (*HashWriter) WriteClose ¶
func (st *HashWriter) WriteClose(p []byte) (err error)
type LruCache ¶
type LruCache struct {
// contains filtered or unexported fields
}
A fixed entry count cache with LRU eviction policy.
Should be protected by a Mutex (not RWMutex) for all methods.
func NewLruCache ¶
func (*LruCache) AverageAge ¶
type ServeSplice ¶
type ServeSplice struct {
// contains filtered or unexported fields
}
type Store ¶
type Store struct { // Should not change option values after initalizing. Options *StoreOptions // contains filtered or unexported fields }
Content based addressing cache.
func NewStore ¶
func NewStore(options *StoreOptions, timings *stats.TimerStats) *Store
NewStore creates a content cache based in directory d. memorySize sets the maximum number of file contents to keep in memory.
func (*Store) DestructiveSavePath ¶
func (*Store) NewHashWriter ¶
func (store *Store) NewHashWriter() *HashWriter
func (*Store) ServeConn ¶
func (c *Store) ServeConn(conn io.ReadWriteCloser)
func (*Store) ThroughputStats ¶
type StoreOptions ¶
type ThroughputSample ¶
type ThroughputSample struct {
// contains filtered or unexported fields
}
func (*ThroughputSample) AddSample ¶
func (s *ThroughputSample) AddSample(r stats.Sample)
func (*ThroughputSample) CopySample ¶
func (s *ThroughputSample) CopySample() stats.Sample
func (*ThroughputSample) String ¶
func (s *ThroughputSample) String() string
func (*ThroughputSample) SubtractSample ¶
func (s *ThroughputSample) SubtractSample(r stats.Sample)
func (*ThroughputSample) TableHeader ¶
func (s *ThroughputSample) TableHeader() string
func (*ThroughputSample) TableRow ¶
func (s *ThroughputSample) TableRow() string
Click to show internal directories.
Click to hide internal directories.