Documentation
¶
Index ¶
- Constants
- func BuildMetadataBucketName(id string) string
- func LoadShare(svc *providers.Service, ref string) (string, error)
- func RemoveHost(svc *providers.Service, host *model.Host) error
- func RemoveNetwork(svc *providers.Service, net *model.Network) error
- func RemoveShare(svc *providers.Service, hostID, hostName, shareID, shareName string) error
- func RemoveVolume(svc *providers.Service, volumeID string) error
- func SaveGateway(svc *providers.Service, host *model.Host, networkID string) error
- func SaveHost(svc *providers.Service, host *model.Host) error
- func SaveNetwork(svc *providers.Service, net *model.Network) error
- func SaveShare(svc *providers.Service, hostID, hostName, shareID, shareName string) error
- func SaveVolume(svc *providers.Service, volume *model.Volume) error
- type Gateway
- type Host
- func (mh *Host) Acquire()
- func (mh *Host) Browse(callback func(*model.Host) error) error
- func (mh *Host) Carry(host *model.Host) *Host
- func (mh *Host) Delete() error
- func (mh *Host) Get() *model.Host
- func (mh *Host) ReadByID(id string) (bool, error)
- func (mh *Host) ReadByName(name string) (bool, error)
- func (mh *Host) Release()
- func (mh *Host) Write() error
- type Network
- func (m *Network) Acquire()
- func (m *Network) AttachHost(host *model.Host) error
- func (m *Network) Browse(callback func(*model.Network) error) error
- func (m *Network) Carry(network *model.Network) *Network
- func (m *Network) Delete() error
- func (m *Network) DetachHost(hostID string) error
- func (m *Network) Get() *model.Network
- func (m *Network) GetPath() string
- func (m *Network) ListHosts() ([]*model.Host, error)
- func (m *Network) ReadByID(id string) (bool, error)
- func (m *Network) ReadByName(name string) (bool, error)
- func (m *Network) Release()
- func (m *Network) Reload() error
- func (m *Network) Write() error
- type Share
- func (ms *Share) Acquire()
- func (ms *Share) Browse(callback func(string, string) error) error
- func (ms *Share) Carry(hostID, hostName, shareID, shareName string) *Share
- func (ms *Share) Delete() error
- func (ms *Share) Get() string
- func (ms *Share) ReadByID(id string) (bool, error)
- func (ms *Share) ReadByName(name string) (bool, error)
- func (ms *Share) Release()
- func (ms *Share) Write() error
- type Volume
- func (mv *Volume) Browse(callback func(*model.Volume) error) error
- func (mv *Volume) Carry(volume *model.Volume) *Volume
- func (mv *Volume) Delete() error
- func (mv *Volume) Get() *model.Volume
- func (mv *Volume) ReadByID(id string) (bool, error)
- func (mv *Volume) ReadByName(name string) (bool, error)
- func (mv *Volume) Reload() error
- func (mv *Volume) Write() error
Constants ¶
const ( //ByIDFolderName tells in what folder to put 'byID' information ByIDFolderName = "byID" //ByNameFolderName tells in what folder to store 'byName' information ByNameFolderName = "byName" // BucketNamePrefix is the begining of the name of the bucket for Metadata BucketNamePrefix = "0.safescale" )
Variables ¶
This section is empty.
Functions ¶
func BuildMetadataBucketName ¶
BuildMetadataBucketName builds the name of the bucket/container that will store metadata id must be a unique identifier of the tenant (not the tenant itself, probability of having same name for 2 different customers isn't zero; this can be domain or project name)
func LoadShare ¶
LoadShare returns the name of the host owing the share 'ref', read from Object Storage
func RemoveHost ¶
RemoveHost removes the host definition from Object Storage
func RemoveNetwork ¶
RemoveNetwork removes the Network definition from Object Storage
func RemoveShare ¶
RemoveShare removes the share definition from Object Storage
func RemoveVolume ¶
RemoveVolume removes the Volume definition from Object Storage
func SaveGateway ¶
SaveGateway saves the metadata of a gateway
func SaveNetwork ¶
SaveNetwork saves the Network definition in Object Storage
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway links Object Storage folder and Network
func LoadGateway ¶
LoadGateway returns the metadata of the Gateway of a network
func NewGateway ¶
NewGateway creates an instance of metadata.Gateway
func (*Gateway) Acquire ¶
func (mg *Gateway) Acquire()
Acquire waits until the write lock is available, then locks the metadata
func (*Gateway) Read ¶
Read reads the metadata of a gateway of a network identified by ID from Object Storage
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host links Object Storage folder and Network
func LoadHostByID ¶
LoadHostByID gets the host definition from Object Storage
func LoadHostByName ¶
LoadHostByName gets the Network definition from Object Storage
func (*Host) Acquire ¶
func (mh *Host) Acquire()
Acquire waits until the write lock is available, then locks the metadata
func (*Host) ReadByID ¶
ReadByID reads the metadata of a network identified by ID from Object Storage
func (*Host) ReadByName ¶
ReadByName reads the metadata of a network identified by name
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network links Object Storage folder and Network
func LoadNetwork ¶
LoadNetwork gets the Network definition from Object Storage
func LoadNetworkByID ¶
LoadNetworkByID gets the Network definition from Object Storage
func LoadNetworkByName ¶
LoadNetworkByName gets the Network definition from Object Storage
func NewNetwork ¶
NewNetwork creates an instance of network.Metadata
func (*Network) Acquire ¶
func (m *Network) Acquire()
Acquire waits until the write lock is available, then locks the metadata
func (*Network) AttachHost ¶
AttachHost links host ID to the network
func (*Network) DetachHost ¶
DetachHost unlinks host ID to network
func (*Network) ListHosts ¶
ListHosts returns the list of model.Host attached to the network (not including gateway)
func (*Network) ReadByID ¶
ReadByID reads the metadata of a network identified by ID from Object Storage
func (*Network) ReadByName ¶
ReadByName reads the metadata of a network identified by name
type Share ¶
type Share struct {
// contains filtered or unexported fields
}
Share contains information to maintain in Object Storage a list of shared folders
func (*Share) Acquire ¶
func (ms *Share) Acquire()
Acquire waits until the write lock is available, then locks the metadata
func (*Share) ReadByID ¶
ReadByID reads the metadata of an export identified by ID from Object Storage
func (*Share) ReadByName ¶
ReadByName reads the metadata of a nas identified by name
type Volume ¶
type Volume struct {
// contains filtered or unexported fields
}
Volume links Object Storage folder and Volumes
func LoadVolume ¶
LoadVolume gets the Volume definition from Object Storage
func (*Volume) ReadByID ¶
ReadByID reads the metadata of a volume identified by ID from Object Storage
func (*Volume) ReadByName ¶
ReadByName reads the metadata of a volume identified by name