manager

package
v0.0.0-...-57b83e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

func (*DefaultManager) Update

func (m *DefaultManager) Update(policy *model.Policy) error

Update Update the specified policy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL