Documentation ¶
Index ¶
- type DefaultManager
- func (m *DefaultManager) Create(policy *model.Policy) (int64, error)
- func (m *DefaultManager) Get(policyID int64) (*model.Policy, error)
- func (m *DefaultManager) GetByName(name string) (*model.Policy, error)
- func (m *DefaultManager) List(queries ...*model.PolicyQuery) (total int64, policies []*model.Policy, err error)
- func (m *DefaultManager) Remove(policyID int64) error
- func (m *DefaultManager) Update(policy *model.Policy) error
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) Create ¶
func (m *DefaultManager) Create(policy *model.Policy) (int64, error)
Create 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) Get ¶
func (m *DefaultManager) Get(policyID int64) (*model.Policy, error)
Get returns the policy with the specified ID
func (*DefaultManager) GetByName ¶
func (m *DefaultManager) GetByName(name string) (*model.Policy, error)
GetByName returns the policy with the specified name
func (*DefaultManager) List ¶
func (m *DefaultManager) List(queries ...*model.PolicyQuery) (total int64, policies []*model.Policy, err error)
List returns all the policies
func (*DefaultManager) Remove ¶
func (m *DefaultManager) Remove(policyID int64) error
Remove Remove the specified policy
Click to show internal directories.
Click to hide internal directories.