Versions in this module Expand all Collapse all v0 v0.1.1 Jun 21, 2016 Changes in this version + var BucketKey = "BucketKey" + var CreatedAtKey = "CreatedAt" + var ErrEmptyID = fmt.Errorf("empty_id") + var ErrEmptyName = fmt.Errorf("empty_name") + var ErrInvalidData = fmt.Errorf("invalid_data") + var ErrNotFound = fmt.Errorf("not_found") + var ErrNotFoundBucket = fmt.Errorf("not_found_bucket") + var LocalStoreDefaultStorePath = "./workspaces.dbox/" + var MapDataIDMetaKey = "MapDataID" + var MapDataStoreNameKey = "MapDataStoreNameKey" + var MetaDataFileStoreNameKey = "MetaDataFileStoreNameKey" + var NameKey = "NameKey" + var RawDataIDMetaKey = "RawDataID" + var RawDataStoreNameKey = "RawDataStoreNameKey" + var UpdatedAtKey = "UpdatedAt" + func InitDefaultBuckets() + func InitDefaultStores() + func NewUUID() string + func RegistryStore(name string, store Store) + type BoltDBStore struct + func NewBoltDBStore(db *bolt.DB, bucketname string) *BoltDBStore + func (s *BoltDBStore) Delete(obj Object) (err error) + func (s *BoltDBStore) Save(obj Object) (err error) + func (s BoltDBStore) Get(id string, obj Object) error + func (s BoltDBStore) GetByName(name string, obj Object) error + func (s BoltDBStore) Type() StoreType + type Bucket struct + func BucketByName(name string) (file *Bucket, err error) + func NewBucket() *Bucket + func (Bucket) Type() EntityType + func (b Bucket) MapDataStoreName() string + func (b Bucket) MetaDataStoreName() string + func (b Bucket) RawDataStoreName() string + func (b Bucket) SetMapDataStoreName(v string) + func (b Bucket) SetMetaDataStoreName(v string) + func (b Bucket) SetRawDataStoreName(v string) + func (o Bucket) Bytes() []byte + func (o Bucket) ID() string + func (o Bucket) IsNew() bool + func (o Bucket) SetID(id string) + func (o Bucket) Write(p []byte) + type EntityType string + var BucketEntityType EntityType = "bucket" + var FileEntityType EntityType = "file" + type File struct + func LoadOrNewFile(bucketName string, fileName string) (file *File, err error) + func NewFile(store Store) *File + func NewFileID(id string, store Store) (file *File, err error) + func NewFileName(name string, store Store) (file *File, err error) + func (File) Type() EntityType + func (f *File) BeforeCreate() + func (f *File) BeforeUpdate() + func (f *File) Delete() error + func (f *File) Import(b []byte) error + func (f *File) MapData() map[string]interface{} + func (f *File) Meta() map[string]interface{} + func (f *File) RawData() Object + func (f *File) SetMapDataStore(s Store) + func (f *File) SetRawDataStore(s Store) + func (f *File) Sync() error + func (f File) Bucket() string + func (f File) CreatedAt() time.Time + func (f File) Export() ([]byte, error) + func (f File) Name() string + func (f File) SetBucket(v string) + func (f File) SetName(v string) + func (f File) String() string + func (f File) UpdatedAt() time.Time + func (o File) Bytes() []byte + func (o File) ID() string + func (o File) IsNew() bool + func (o File) SetID(id string) + func (o File) Write(p []byte) + type FileStore interface + GetByName func(name string, obj Object) error + type LocalStore struct + func NewLocalStore(path string) *LocalStore + func (s *LocalStore) Delete(obj Object) (err error) + func (s *LocalStore) Save(obj Object) (err error) + func (s LocalStore) Get(id string, obj Object) error + func (s LocalStore) GetByName(name string, obj Object) error + func (s LocalStore) Type() StoreType + type MapObject struct + func NewMapObject(store Store) *MapObject + func (f *MapObject) Encode() (err error) + func (f *MapObject) Sync() error + func (f MapObject) Decode() error + func (f MapObject) Map() map[string]interface{} + func (o *MapObject) SetID(id string) + func (o *MapObject) Write(p []byte) + func (o MapObject) Bytes() []byte + func (o MapObject) ID() string + func (o MapObject) IsNew() bool + type MemoryStore struct + func NewMemoryStore() *MemoryStore + func NewMemoryStoreName(name string) *MemoryStore + func (s *MemoryStore) Delete(obj Object) (err error) + func (s *MemoryStore) Save(obj Object) (err error) + func (s MemoryStore) Get(id string, obj Object) error + func (s MemoryStore) GetByName(name string, obj Object) error + func (s MemoryStore) Name() string + func (s MemoryStore) Type() StoreType + type Object interface + Bytes func() []byte + Decode func() error + Encode func() error + ID func() string + SetID func(string) + Sync func() error + Write func(p []byte) + type Objects struct + func (o Objects) HasNext() bool + func (o Objects) Len() int + func (o Objects) MarshalJSON() ([]byte, error) + func (o Objects) NextPage() int + func (o Objects) Total() int + type RawObject struct + func NewRawObject(store Store) *RawObject + func (f *RawObject) Encode() error + func (f *RawObject) Sync() error + func (f RawObject) Decode() error + func (o *RawObject) SetID(id string) + func (o *RawObject) Write(p []byte) + func (o RawObject) Bytes() []byte + func (o RawObject) ID() string + func (o RawObject) IsNew() bool + type RefObject struct + func NewRefObject(store Store) *RefObject + func (f *RefObject) Encode() error + func (f *RefObject) SetID(v string) + func (f *RefObject) SetRefID(v string) + func (f *RefObject) Sync() error + func (f RefObject) Decode() error + func (f RefObject) ID() string + func (f RefObject) RefID() string + func (o *RefObject) Write(p []byte) + func (o RefObject) Bytes() []byte + func (o RefObject) IsNew() bool + type Store interface + Delete func(Object) error + Get func(id string, obj Object) error + Save func(Object) error + Type func() StoreType + var BucketStore Store + func MustStore(name string) Store + type StoreType string + const BoltDBStoreType + const LocalStoreType + const MemoryStoreType