Initial commit
This commit is contained in:
27
cas/cas.go
Normal file
27
cas/cas.go
Normal file
@ -0,0 +1,27 @@
|
||||
// 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
|
||||
}
|
Reference in New Issue
Block a user