Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Mgr = New()
Mgr is the global instance manager instance
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // Save the instance metadata to the backend store // // inst *Instance : a ptr of instance // // If succeed, the uuid of the saved instance is returned; // otherwise, a non nil error is returned // Save(ctx context.Context, inst *provider.Instance) (int64, error) // Delete the specified instance // // id int64 : the id of the instance // // If succeed, a nil error is returned; // otherwise, a non nil error is returned // Delete(ctx context.Context, id int64) error // Update the specified instance // // inst *Instance : a ptr of instance // // If succeed, a nil error is returned; // otherwise, a non nil error is returned // Update(ctx context.Context, inst *provider.Instance, props ...string) error // Get the instance with the ID // // id int64 : the id of the instance // // If succeed, a non nil Instance is returned; // otherwise, a non nil error is returned // Get(ctx context.Context, id int64) (*provider.Instance, error) // GetByName gets the repository specified by name // name string : the global unique name of the instance GetByName(ctx context.Context, name string) (*provider.Instance, error) // Count the instances by the param // // query *q.Query : the query params Count(ctx context.Context, query *q.Query) (int64, error) // Query the instances by the param // // query *q.Query : the query params // // If succeed, an instance list is returned; // otherwise, a non nil error is returned // List(ctx context.Context, query *q.Query) ([]*provider.Instance, error) }
Manager is responsible for storing the instances
Click to show internal directories.
Click to hide internal directories.