policy

package
v1.5.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2018 License: Apache-2.0 Imports: 6 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) 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

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

Jump to

Keyboard shortcuts

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