Documentation ¶
Index ¶
- Variables
- func InitDefaultBuckets()
- func InitDefaultStores()
- func NewUUID() string
- func RegistryStore(name string, store Store)
- type BoltDBStore
- type Bucket
- func (o Bucket) Bytes() []byte
- func (o Bucket) ID() string
- func (o Bucket) IsNew() bool
- func (b Bucket) MapDataStoreName() string
- func (b Bucket) MetaDataStoreName() string
- func (b Bucket) RawDataStoreName() string
- func (o Bucket) SetID(id string)
- func (b Bucket) SetMapDataStoreName(v string)
- func (b Bucket) SetMetaDataStoreName(v string)
- func (b Bucket) SetRawDataStoreName(v string)
- func (Bucket) Type() EntityType
- func (o Bucket) Write(p []byte)
- type EntityType
- type File
- func (f *File) BeforeCreate()
- func (f *File) BeforeUpdate()
- func (f File) Bucket() string
- func (o File) Bytes() []byte
- func (f File) CreatedAt() time.Time
- func (f *File) Delete() error
- func (f File) Export() ([]byte, error)
- func (o File) ID() string
- func (f *File) Import(b []byte) error
- func (o File) IsNew() bool
- func (f *File) MapData() map[string]interface{}
- func (f *File) Meta() map[string]interface{}
- func (f File) Name() string
- func (f *File) RawData() Object
- func (f File) SetBucket(v string)
- func (o File) SetID(id string)
- func (f *File) SetMapDataStore(s Store)
- func (f File) SetName(v string)
- func (f *File) SetRawDataStore(s Store)
- func (f File) String() string
- func (f *File) Sync() error
- func (File) Type() EntityType
- func (f File) UpdatedAt() time.Time
- func (o File) Write(p []byte)
- type FileStore
- type LocalStore
- type MapObject
- func (o MapObject) Bytes() []byte
- func (f MapObject) Decode() error
- func (f *MapObject) Encode() (err error)
- func (o MapObject) ID() string
- func (o MapObject) IsNew() bool
- func (f MapObject) Map() map[string]interface{}
- func (o *MapObject) SetID(id string)
- func (f *MapObject) Sync() error
- func (o *MapObject) Write(p []byte)
- type MemoryStore
- type Object
- type Objects
- type RawObject
- type RefObject
- func (o RefObject) Bytes() []byte
- func (f RefObject) Decode() error
- func (f *RefObject) Encode() error
- func (f RefObject) ID() string
- func (o RefObject) IsNew() bool
- func (f RefObject) RefID() string
- func (f *RefObject) SetID(v string)
- func (f *RefObject) SetRefID(v string)
- func (f *RefObject) Sync() error
- func (o *RefObject) Write(p []byte)
- type Store
- type StoreType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = fmt.Errorf("not_found") ErrNotFoundBucket = fmt.Errorf("not_found_bucket") ErrInvalidData = fmt.Errorf("invalid_data") ErrEmptyName = fmt.Errorf("empty_name") ErrEmptyID = fmt.Errorf("empty_id") )
View Source
var ( NameKey = "NameKey" MapDataIDMetaKey = "MapDataID" RawDataIDMetaKey = "RawDataID" CreatedAtKey = "CreatedAt" UpdatedAtKey = "UpdatedAt" BucketKey = "BucketKey" MapDataStoreNameKey = "MapDataStoreNameKey" RawDataStoreNameKey = "RawDataStoreNameKey" MetaDataFileStoreNameKey = "MetaDataFileStoreNameKey" )
View Source
var LocalStoreDefaultStorePath = "./workspaces.dbox/"
Functions ¶
func InitDefaultBuckets ¶
func InitDefaultBuckets()
func InitDefaultStores ¶
func InitDefaultStores()
func RegistryStore ¶
Types ¶
type BoltDBStore ¶
type BoltDBStore struct {
// contains filtered or unexported fields
}
func NewBoltDBStore ¶
func NewBoltDBStore(db *bolt.DB, bucketname string) *BoltDBStore
func (*BoltDBStore) Delete ¶
func (s *BoltDBStore) Delete(obj Object) (err error)
func (BoltDBStore) GetByName ¶
func (s BoltDBStore) GetByName(name string, obj Object) error
GetByName Get object by name (via ReObject)
func (*BoltDBStore) Save ¶
func (s *BoltDBStore) Save(obj Object) (err error)
func (BoltDBStore) Type ¶
func (s BoltDBStore) Type() StoreType
type Bucket ¶
type Bucket struct {
File
}
func BucketByName ¶
BucketByName return bucket from name if not exist file, file accepts values nil, err accepts values ErrNotFound
func (Bucket) MapDataStoreName ¶
func (Bucket) MetaDataStoreName ¶
func (Bucket) RawDataStoreName ¶
func (Bucket) SetMapDataStoreName ¶
func (Bucket) SetMetaDataStoreName ¶
func (Bucket) SetRawDataStoreName ¶
func (Bucket) Type ¶
func (Bucket) Type() EntityType
type EntityType ¶
type EntityType string
var ( FileEntityType EntityType = "file" BucketEntityType EntityType = "bucket" )
type File ¶
type File struct { *MapObject // contains filtered or unexported fields }
func LoadOrNewFile ¶
LoadOrNewFile return file by bucket name and filename. If not exist bucket, file accepts values nil, err accepts values ErrNotFoundBucket. If not exist file, file accepts values nil, err accepts values ErrNotFound. In cases where file not exist, file name and file bucket name accepts values from arguments.
func NewFileName ¶
NewFileName return file by filename. In cases where file not exist, file name accepts values from arguments.
func (*File) BeforeCreate ¶
func (f *File) BeforeCreate()
func (*File) BeforeUpdate ¶
func (f *File) BeforeUpdate()
func (*File) SetMapDataStore ¶
func (*File) SetRawDataStore ¶
func (File) Type ¶
func (File) Type() EntityType
type LocalStore ¶
type LocalStore struct {
// contains filtered or unexported fields
}
func NewLocalStore ¶
func NewLocalStore(path string) *LocalStore
func (*LocalStore) Delete ¶
func (s *LocalStore) Delete(obj Object) (err error)
func (*LocalStore) Save ¶
func (s *LocalStore) Save(obj Object) (err error)
func (LocalStore) Type ¶
func (s LocalStore) Type() StoreType
type MapObject ¶
type MapObject struct {
// contains filtered or unexported fields
}
func NewMapObject ¶
type MemoryStore ¶
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func NewMemoryStoreName ¶
func NewMemoryStoreName(name string) *MemoryStore
func (*MemoryStore) Delete ¶
func (s *MemoryStore) Delete(obj Object) (err error)
func (MemoryStore) Name ¶
func (s MemoryStore) Name() string
func (*MemoryStore) Save ¶
func (s *MemoryStore) Save(obj Object) (err error)
func (MemoryStore) Type ¶
func (s MemoryStore) Type() StoreType
type Objects ¶
func (Objects) MarshalJSON ¶
type RawObject ¶
type RawObject struct {
// contains filtered or unexported fields
}
func NewRawObject ¶
type RefObject ¶
type RefObject struct {
// contains filtered or unexported fields
}
RefObject link filename to a file id
func NewRefObject ¶
Click to show internal directories.
Click to hide internal directories.