Documentation ¶
Index ¶
- Constants
- func Init(dir string, conf *config.Config) error
- func NewWebContent(req *http.Request, resp *http.Response) *schema.WebContent
- func SaveRef(ctx context.Context, path string, fi os.FileInfo, ref types.Ref) error
- func SaveRefFile(ctx context.Context, f *os.File, fi os.FileInfo, ref types.Ref) error
- type Concat
- type FileDesc
- type OpenOptions
- type Ref
- type SchemaIterator
- type SchemaRef
- type SizedRef
- type SplitConfig
- type SplitFunc
- type Stats
- type Storage
- func (s *Storage) BeginBlob(ctx context.Context) (storage.BlobWriter, error)
- func (s *Storage) Checkout(ctx context.Context, ref Ref, dst string) error
- func (s *Storage) Close() error
- func (s *Storage) DecodeSchema(ctx context.Context, ref types.Ref) (schema.Object, error)
- func (s *Storage) DeletePin(ctx context.Context, name string) error
- func (s *Storage) FetchBlob(ctx context.Context, ref Ref) (io.ReadCloser, uint64, error)
- func (s *Storage) FetchSchema(ctx context.Context, ref types.Ref) (io.ReadCloser, uint64, error)
- func (s *Storage) GetPin(ctx context.Context, name string) (types.Ref, error)
- func (s *Storage) GetPinOrRef(ctx context.Context, name string) (types.Ref, error)
- func (s *Storage) IterateBlobs(ctx context.Context) storage.Iterator
- func (s *Storage) IterateDataBlobsIn(ctx context.Context, root Ref) storage.Iterator
- func (s *Storage) IteratePins(ctx context.Context) storage.PinIterator
- func (s *Storage) IterateSchema(ctx context.Context, typs ...string) SchemaIterator
- func (s *Storage) ReindexSchema(ctx context.Context, force bool) error
- func (s *Storage) SetPin(ctx context.Context, name string, ref types.Ref) error
- func (s *Storage) StatBlob(ctx context.Context, ref Ref) (uint64, error)
- func (s *Storage) StoreAddr(ctx context.Context, addr string, conf *StoreConfig) (types.SizedRef, error)
- func (s *Storage) StoreAsFile(ctx context.Context, fd FileDesc, conf *StoreConfig) (SizedRef, error)
- func (s *Storage) StoreBlob(ctx context.Context, r io.Reader, conf *StoreConfig) (SizedRef, error)
- func (s *Storage) StoreFilePath(ctx context.Context, path string, conf *StoreConfig) (SizedRef, error)
- func (s *Storage) StoreHTTPContent(ctx context.Context, req *http.Request, conf *StoreConfig) (SizedRef, error)
- func (s *Storage) StoreSchema(ctx context.Context, o schema.Object) (SizedRef, error)
- func (s *Storage) StoreURLContent(ctx context.Context, url string, conf *StoreConfig) (SizedRef, error)
- func (s *Storage) SyncBlob(ctx context.Context, ref Ref) (Ref, error)
- type StoreConfig
Constants ¶
View Source
const ( DefaultDir = ".cas" DefaultPin = "root" )
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init configures a CAS and stores the metadata in a specified directory. If directory path is empty, default path will be used. Relative paths in a local storage configs will be interpreted relative to the config.
func NewWebContent ¶
Types ¶
type FileDesc ¶
type OpenOptions ¶
type SchemaIterator ¶
type SchemaIterator = storage.SchemaIterator
type SizedRef ¶
type SplitConfig ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func Open ¶
func Open(opt OpenOptions) (*Storage, error)
func (*Storage) DecodeSchema ¶
func (*Storage) FetchSchema ¶
func (*Storage) GetPinOrRef ¶
func (*Storage) IterateDataBlobsIn ¶
IterateDataBlobsIn iterates all non-schema blobs in the provided schema blob.
func (*Storage) IteratePins ¶
func (s *Storage) IteratePins(ctx context.Context) storage.PinIterator
func (*Storage) IterateSchema ¶
func (s *Storage) IterateSchema(ctx context.Context, typs ...string) SchemaIterator
func (*Storage) ReindexSchema ¶
func (*Storage) StoreAddr ¶
func (s *Storage) StoreAddr(ctx context.Context, addr string, conf *StoreConfig) (types.SizedRef, error)
StoreAddr interprets an address as either a local FS path or URL and fetches the content. It will create schema objects automatically.
func (*Storage) StoreAsFile ¶
func (*Storage) StoreFilePath ¶
func (*Storage) StoreHTTPContent ¶
func (*Storage) StoreSchema ¶
func (*Storage) StoreURLContent ¶
type StoreConfig ¶
type StoreConfig struct { Expect types.SizedRef // expected size and ref; can be set separately IndexOnly bool // write metadata only Split *SplitConfig }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.