Documentation ¶
Index ¶
- type DefaultManager
- func (m *DefaultManager) CreatePolicy(policy models.ReplicationPolicy) (int64, error)
- func (m *DefaultManager) GetPolicies(query models.QueryParameter) (*models.ReplicationPolicyQueryResult, error)
- func (m *DefaultManager) GetPolicy(policyID int64) (models.ReplicationPolicy, error)
- func (m *DefaultManager) RemovePolicy(policyID int64) error
- func (m *DefaultManager) UpdatePolicy(policy models.ReplicationPolicy) error
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultManager ¶
type DefaultManager struct{}
DefaultManager provides replication policy CURD capabilities.
func NewDefaultManager ¶
func NewDefaultManager() *DefaultManager
NewDefaultManager is the constructor of DefaultManager.
func (*DefaultManager) CreatePolicy ¶
func (m *DefaultManager) CreatePolicy(policy models.ReplicationPolicy) (int64, error)
CreatePolicy creates a new policy with the provided data; If creating failed, error will be returned; If creating succeed, ID of the new created policy will be returned.
func (*DefaultManager) GetPolicies ¶
func (m *DefaultManager) GetPolicies(query models.QueryParameter) (*models.ReplicationPolicyQueryResult, error)
GetPolicies returns all the policies
func (*DefaultManager) GetPolicy ¶
func (m *DefaultManager) GetPolicy(policyID int64) (models.ReplicationPolicy, error)
GetPolicy returns the policy with the specified ID
func (*DefaultManager) RemovePolicy ¶
func (m *DefaultManager) RemovePolicy(policyID int64) error
RemovePolicy removes the specified policy; If removing failed, error will be returned.
func (*DefaultManager) UpdatePolicy ¶
func (m *DefaultManager) UpdatePolicy(policy models.ReplicationPolicy) error
UpdatePolicy updates the policy; If updating failed, error will be returned.
type Manager ¶
type Manager interface { GetPolicies(models.QueryParameter) (*models.ReplicationPolicyQueryResult, error) GetPolicy(int64) (models.ReplicationPolicy, error) CreatePolicy(models.ReplicationPolicy) (int64, error) UpdatePolicy(models.ReplicationPolicy) error RemovePolicy(int64) error }
Manager defines the method a policy manger should implement
Click to show internal directories.
Click to hide internal directories.