Documentation ¶
Index ¶
- Constants
- Variables
- func GetDBModels(opts *GetDBModelsOptions) error
- func GetModels(opts *GetModelsOptions) error
- func InitializeModelSetFromJSON(set IModelSet, entriesJson []jsonutils.JSONObject) error
- func ModelSetMaxUpdatedAt(set IModelSet) time.Time
- type APIHelper
- type GetDBModelsOptions
- func (o GetDBModelsOptions) BatchListSize() int
- func (o GetDBModelsOptions) GetModelSet() IModelSet
- func (o GetDBModelsOptions) InCludeOtherCloudEnv() bool
- func (o GetDBModelsOptions) IncludeDetails() bool
- func (o GetDBModelsOptions) IncludeEmulated() bool
- func (o GetDBModelsOptions) IncludeOtherCloudEnv() bool
- type GetModelsOptions
- type IDBModelSet
- type IDBModelSets
- type IModelListParam
- type IModelListSetParams
- type IModelSet
- type IModelSetEmulatedIncluder
- type IModelSetFilter
- type IModelSets
- type ModelSetUpdateResult
- type ModelSetsUpdateResult
- type Options
Constants ¶
View Source
const ( MinSyncIntervalSeconds = 10 MinRunDelayMilliseconds = 100 )
Variables ¶
View Source
var PseudoZeroTime = time.Time{}.Add(time.Nanosecond)
A hack to workaround the IsZero() in timeutils.Utcify. This depends on the fact that database time has a resolution of 1-second
Functions ¶
func GetDBModels ¶
func GetDBModels(opts *GetDBModelsOptions) error
func GetModels ¶
func GetModels(opts *GetModelsOptions) error
func InitializeModelSetFromJSON ¶
func InitializeModelSetFromJSON(set IModelSet, entriesJson []jsonutils.JSONObject) error
func ModelSetMaxUpdatedAt ¶
Types ¶
type APIHelper ¶
type APIHelper struct {
// contains filtered or unexported fields
}
func NewAPIHelper ¶
func NewAPIHelper(opts *Options, modelSets IModelSets) (*APIHelper, error)
func (*APIHelper) ModelSets ¶
func (h *APIHelper) ModelSets() <-chan IModelSets
func (*APIHelper) RunManually ¶
type GetDBModelsOptions ¶
type GetDBModelsOptions struct {
// contains filtered or unexported fields
}
func (GetDBModelsOptions) BatchListSize ¶
func (o GetDBModelsOptions) BatchListSize() int
func (GetDBModelsOptions) GetModelSet ¶
func (o GetDBModelsOptions) GetModelSet() IModelSet
func (GetDBModelsOptions) InCludeOtherCloudEnv ¶
func (o GetDBModelsOptions) InCludeOtherCloudEnv() bool
func (GetDBModelsOptions) IncludeDetails ¶
func (o GetDBModelsOptions) IncludeDetails() bool
func (GetDBModelsOptions) IncludeEmulated ¶
func (o GetDBModelsOptions) IncludeEmulated() bool
func (GetDBModelsOptions) IncludeOtherCloudEnv ¶
func (o GetDBModelsOptions) IncludeOtherCloudEnv() bool
type GetModelsOptions ¶
type GetModelsOptions struct { ClientSession *mcclient.ClientSession ModelManager mcclient_modulebase.IBaseManager ModelSet IModelSet BatchListSize int IncludeDetails bool IncludeEmulated bool InCludeOtherCloudEnv bool }
type IDBModelSet ¶
type IDBModelSet interface { IModelSet DBModelManager() db.IModelManager }
type IDBModelSets ¶
type IDBModelSets interface { IModelSets FetchFromAPIMap(s *mcclient.ClientSession) (IModelSets, error) }
type IModelListParam ¶
type IModelListParam interface {
ModelParamFilter() jsonutils.JSONObject
}
type IModelListSetParams ¶
type IModelSet ¶
type IModelSet interface { ModelManager() mcclient_modulebase.IBaseManager NewModel() db.IModel AddModel(db.IModel) Copy() IModelSet }
type IModelSetEmulatedIncluder ¶
type IModelSetEmulatedIncluder interface {
IncludeEmulated() bool
}
type IModelSetFilter ¶
type IModelSetFilter interface {
ModelFilter() []string
}
type IModelSets ¶
type IModelSets interface { NewEmpty() IModelSets ModelSetList() []IModelSet ApplyUpdates(IModelSets) ModelSetsUpdateResult Copy() IModelSets CopyJoined() IModelSets }
type ModelSetUpdateResult ¶
func ModelSetApplyUpdates ¶
func ModelSetApplyUpdates(aSet, bSet IModelSet) *ModelSetUpdateResult
ModelSetApplyUpdates applies bSet to aSet.
- PendingDeleted in bSet are removed from aSet
- Newer models in bSet are updated in aSet
type ModelSetsUpdateResult ¶
func SyncDBModelSets ¶
func SyncDBModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (r ModelSetsUpdateResult, err error)
func SyncModelSets ¶
func SyncModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (ModelSetsUpdateResult, error)
type Options ¶
type Options struct { common_options.CommonOptions SyncIntervalSeconds int RunDelayMilliseconds int ListBatchSize int IncludeDetails bool IncludeOtherCloudEnv bool FetchFromComputeService bool }
Click to show internal directories.
Click to hide internal directories.