pkg/cas/cas.go

28 lines
504 B
Go
Raw Normal View History

2018-06-12 09:52:20 +00:00
// Package cas provides a content-accessible storage implementation
package cas
import (
"io"
"time"
)
// Content is an item's content.
type Content interface {
io.Reader
io.Seeker
io.Closer
}
// Meta is an item's metadata.
type Meta interface {
Size() int64
ModTime() time.Time
}
// Store is a CAS store.
type Store interface {
GetOrCreate(tag, item string, create func(io.Writer) error) (content Content, meta Meta, err error)
Tags() (tags []string, err error)
Remove(tag string) error
}