Documentation ¶
Index ¶
- type Folder
- func (f *Folder) Browse(path string, callback FolderDecoderCallback) error
- func (f *Folder) Delete(path string, name string) error
- func (f *Folder) GetBucket() objectstorage.Bucket
- func (f *Folder) GetPath() string
- func (f *Folder) GetService() iaas.Service
- func (f *Folder) Read(path string, name string, callback FolderDecoderCallback) error
- func (f *Folder) Search(path string, name string) error
- func (f *Folder) Write(path string, name string, content []byte) error
- type FolderDecoderCallback
- type Item
- func (i *Item) Acquire()
- func (i *Item) Browse(callback func([]byte) error) error
- func (i *Item) BrowseInto(path string, callback func([]byte) error) error
- func (i *Item) Carry(data serialize.Serializable) *Item
- func (i *Item) Delete(name string) error
- func (i *Item) DeleteFrom(path string, name string) error
- func (i *Item) Get() interface{}
- func (i *Item) GetBucket() objectstorage.Bucket
- func (i *Item) GetPath() string
- func (i *Item) GetService() iaas.Service
- func (i *Item) Read(name string, callback ItemDecoderCallback) error
- func (i *Item) ReadFrom(path string, name string, callback ItemDecoderCallback) error
- func (i *Item) Release()
- func (i *Item) Reset() *Item
- func (i *Item) Write(name string) error
- func (i *Item) WriteInto(path string, name string) error
- func (i *Item) Written() bool
- type ItemDecoderCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Folder ¶
type Folder struct {
// contains filtered or unexported fields
}
Folder describes a metadata folder
func NewFolder ¶
NewFolder creates a new Metadata Folder object, ready to help access the metadata inside it
func (*Folder) Browse ¶
func (f *Folder) Browse(path string, callback FolderDecoderCallback) error
Browse browses the content of a specific path in Metadata and executes 'cb' on each entry
func (*Folder) GetBucket ¶
func (f *Folder) GetBucket() objectstorage.Bucket
GetBucket returns the bucket used by the folder to store Object Storage
func (*Folder) GetService ¶
GetService returns the service used by the folder
func (*Folder) Read ¶
func (f *Folder) Read(path string, name string, callback FolderDecoderCallback) error
Read loads the content of the object stored in metadata bucket returns false, nil if the object is not found returns false, err if an error occurred returns true, nil if the object has been found The callback function has to know how to decode it and where to store the result
type FolderDecoderCallback ¶
FolderDecoderCallback is the prototype of the function that will decode data read from Metadata
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item is an entry in the ObjectStorage
func (*Item) Acquire ¶
func (i *Item) Acquire()
Acquire waits until the lock is available, then locks the metadata
func (*Item) BrowseInto ¶
BrowseInto walks through a subfolder and item folder and executes a callback for each entry
func (*Item) Carry ¶
func (i *Item) Carry(data serialize.Serializable) *Item
Carry links metadata with cluster struct
func (*Item) DeleteFrom ¶
DeleteFrom removes a metadata from a folder
func (*Item) GetBucket ¶
func (i *Item) GetBucket() objectstorage.Bucket
GetBucket returns the bucket used by Item
func (*Item) GetService ¶
GetService returns the service used by Item
func (*Item) Read ¶
func (i *Item) Read(name string, callback ItemDecoderCallback) error
Read read metadata of item from Object Storage (in current folder)
func (*Item) ReadFrom ¶
func (i *Item) ReadFrom(path string, name string, callback ItemDecoderCallback) error
ReadFrom reads metadata of item from Object Storage in a subfolder
type ItemDecoderCallback ¶
type ItemDecoderCallback func([]byte) (serialize.Serializable, error)
ItemDecoderCallback ...