Documentation ¶
Index ¶
- Variables
- type Database
- func (db *Database) AddInstance(instance launcher.InstanceInfo) error
- func (db *Database) AddLayer(layer layermanager.LayerInfo) (err error)
- func (db *Database) AddNetworkInfo(networkInfo networkmanager.NetworkParameters) error
- func (db *Database) AddService(service servicemanager.ServiceInfo) (err error)
- func (db *Database) Close()
- func (db *Database) DeleteLayerByDigest(digest string) (err error)
- func (db *Database) GetAllInstances() (instances []launcher.InstanceInfo, err error)
- func (db *Database) GetAllServiceVersions(id string) (services []servicemanager.ServiceInfo, err error)
- func (db *Database) GetInstanceIDs(filter cloudprotocol.InstanceFilter) (instances []string, err error)
- func (db *Database) GetInstanceInfoByID(instanceID string) (ident aostypes.InstanceIdent, version string, err error)
- func (db *Database) GetJournalCursor() (cursor string, err error)
- func (db *Database) GetLayerInfoByDigest(digest string) (layer layermanager.LayerInfo, err error)
- func (db *Database) GetLayersInfo() (layersList []layermanager.LayerInfo, err error)
- func (db *Database) GetNetworksInfo() ([]networkmanager.NetworkParameters, error)
- func (db *Database) GetOnlineTime() (onlineTime time.Time, err error)
- func (db *Database) GetOperationVersion() (version uint64, err error)
- func (db *Database) GetOverrideEnvVars() (vars []cloudprotocol.EnvVarsInstanceInfo, err error)
- func (db *Database) GetServices() (services []servicemanager.ServiceInfo, err error)
- func (db *Database) GetTrafficMonitorData(chain string) (timestamp time.Time, value uint64, err error)
- func (db *Database) RemoveInstance(instanceID string) (err error)
- func (db *Database) RemoveNetworkInfo(networkID string) (err error)
- func (db *Database) RemoveService(serviceID string, version string) (err error)
- func (db *Database) RemoveTrafficMonitorData(chain string) (err error)
- func (db *Database) SetJournalCursor(cursor string) error
- func (db *Database) SetLayerCached(digest string, cached bool) (err error)
- func (db *Database) SetLayerTimestamp(digest string, timestamp time.Time) error
- func (db *Database) SetOnlineTime(onlineTime time.Time) error
- func (db *Database) SetOperationVersion(version uint64) error
- func (db *Database) SetOverrideEnvVars(envVarsInfo []cloudprotocol.EnvVarsInstanceInfo) error
- func (db *Database) SetServiceCached(serviceID string, version string, cached bool) (err error)
- func (db *Database) SetTrafficMonitorData(chain string, timestamp time.Time, value uint64) (err error)
- func (db *Database) UpdateInstance(instance launcher.InstanceInfo) (err error)
Constants ¶
This section is empty.
Variables ¶
var ErrMigrationFailed = errors.New("database migration failed")
ErrMigrationFailed is returned if migration was failed and db returned to the previous state.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database structure with database information.
func (*Database) AddInstance ¶
func (db *Database) AddInstance(instance launcher.InstanceInfo) error
AddInstance adds instance information to db.
func (*Database) AddLayer ¶
func (db *Database) AddLayer(layer layermanager.LayerInfo) (err error)
AddLayer add layer to layers table.
func (*Database) AddNetworkInfo ¶
func (db *Database) AddNetworkInfo(networkInfo networkmanager.NetworkParameters) error
AddNetworkInfo adds network information to db.
func (*Database) AddService ¶
func (db *Database) AddService(service servicemanager.ServiceInfo) (err error)
AddService adds new service.
func (*Database) DeleteLayerByDigest ¶
DeleteLayerByDigest remove layer from DB by digest.
func (*Database) GetAllInstances ¶
func (db *Database) GetAllInstances() (instances []launcher.InstanceInfo, err error)
GetAllInstances returns all instance.
func (*Database) GetAllServiceVersions ¶
func (db *Database) GetAllServiceVersions(id string) (services []servicemanager.ServiceInfo, err error)
GetAllServiceVersions returns all service version by service ID.
func (*Database) GetInstanceIDs ¶
func (db *Database) GetInstanceIDs(filter cloudprotocol.InstanceFilter) (instances []string, err error)
GetInstanceIDs returns instance ids by filter.
func (*Database) GetInstanceInfoByID ¶
func (db *Database) GetInstanceInfoByID( instanceID string, ) (ident aostypes.InstanceIdent, version string, err error)
GetInstanceInfoByID returns instance ident and service aos version by instanceID.
func (*Database) GetJournalCursor ¶
GetJournalCursor retrieves logger cursor.
func (*Database) GetLayerInfoByDigest ¶
func (db *Database) GetLayerInfoByDigest(digest string) (layer layermanager.LayerInfo, err error)
GetLayerInfoByDigest returns layers information by layer digest.
func (*Database) GetLayersInfo ¶
func (db *Database) GetLayersInfo() (layersList []layermanager.LayerInfo, err error)
GetLayersInfo get all installed layers.
func (*Database) GetNetworksInfo ¶
func (db *Database) GetNetworksInfo() ([]networkmanager.NetworkParameters, error)
GetNetworkInfo returns networks information.
func (*Database) GetOnlineTime ¶
GetOnlineTime returns previously stored online time.
func (*Database) GetOperationVersion ¶
GetOperationVersion returns operation version.
func (*Database) GetOverrideEnvVars ¶
func (db *Database) GetOverrideEnvVars() (vars []cloudprotocol.EnvVarsInstanceInfo, err error)
GetOverrideEnvVars returns override env vars.
func (*Database) GetServices ¶
func (db *Database) GetServices() (services []servicemanager.ServiceInfo, err error)
GetServices returns all services.
func (*Database) GetTrafficMonitorData ¶
func (db *Database) GetTrafficMonitorData(chain string) (timestamp time.Time, value uint64, err error)
GetTrafficMonitorData stores traffic monitor data.
func (*Database) RemoveInstance ¶
RemoveInstance removes instance information from db.
func (*Database) RemoveNetworkInfo ¶
RemoveNetworkInfo removes network information from db.
func (*Database) RemoveService ¶
RemoveService removes existing service.
func (*Database) RemoveTrafficMonitorData ¶
RemoveTrafficMonitorData removes existing traffic monitor entry.
func (*Database) SetJournalCursor ¶
SetJournalCursor stores system logger cursor.
func (*Database) SetLayerCached ¶
SetLayerCached sets cached status for the layer.
func (*Database) SetLayerTimestamp ¶
SetLayerTimestamp sets timestamp for the layer.
func (*Database) SetOnlineTime ¶
SetOnlineTime sets online time.
func (*Database) SetOperationVersion ¶
SetOperationVersion sets operation version.
func (*Database) SetOverrideEnvVars ¶
func (db *Database) SetOverrideEnvVars(envVarsInfo []cloudprotocol.EnvVarsInstanceInfo) error
SetOverrideEnvVars updates override env vars.
func (*Database) SetServiceCached ¶
SetServiceCached sets cached status for the service.
func (*Database) SetTrafficMonitorData ¶
func (db *Database) SetTrafficMonitorData(chain string, timestamp time.Time, value uint64) (err error)
SetTrafficMonitorData stores traffic monitor data.
func (*Database) UpdateInstance ¶
func (db *Database) UpdateInstance(instance launcher.InstanceInfo) (err error)
UpdateInstance updates instance information in db.