bkpbuilder

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder is the builder object for ZFSBackup

func BuildFrom

func BuildFrom(bkp *apis.ZFSBackup) *Builder

BuildFrom returns new instance of Builder from the provided api instance

func NewBuilder

func NewBuilder() *Builder

NewBuilder returns new instance of Builder

func (*Builder) Build

func (b *Builder) Build() (*apis.ZFSBackup, error)

Build returns ZFSBackup API object

func (*Builder) WithFinalizer

func (b *Builder) WithFinalizer(finalizer []string) *Builder

WithFinalizer merge existing finalizers if any with the ones that are provided here

func (*Builder) WithLabels

func (b *Builder) WithLabels(labels map[string]string) *Builder

WithLabels merges existing labels if any with the ones that are provided here

func (*Builder) WithName

func (b *Builder) WithName(name string) *Builder

WithName sets the name of ZFSBackup

func (*Builder) WithNamespace

func (b *Builder) WithNamespace(namespace string) *Builder

WithNamespace sets the namespace of ZFSBackup

func (*Builder) WithNode

func (b *Builder) WithNode(node string) *Builder

WithNode sets the owenr node for the ZFSBackup

func (*Builder) WithPrevSnap

func (b *Builder) WithPrevSnap(snap string) *Builder

WithPrevSnap sets the previous snapshot for ZFSBackup

func (*Builder) WithRemote

func (b *Builder) WithRemote(server string) *Builder

WithRemote sets the remote address for the ZFSBackup

func (*Builder) WithSnap

func (b *Builder) WithSnap(snap string) *Builder

WithSnap sets the snapshot for ZFSBackup

func (*Builder) WithStatus

func (b *Builder) WithStatus(status apis.ZFSBackupStatus) *Builder

WithStatus sets the status of the Backup progress

func (*Builder) WithVolume

func (b *Builder) WithVolume(volume string) *Builder

WithVolume sets the volume name of ZFSBackup

type Kubeclient

type Kubeclient struct {
	// contains filtered or unexported fields
}

Kubeclient enables kubernetes API operations on zfsbkp bkpume instance

func NewKubeclient

func NewKubeclient(opts ...KubeclientBuildOption) *Kubeclient

NewKubeclient returns a new instance of kubeclient meant for zfsbkp bkpume operations

func (*Kubeclient) Create

func (k *Kubeclient) Create(bkp *apis.ZFSBackup) (*apis.ZFSBackup, error)

Create creates a zfsbkp bkpume instance in kubernetes cluster

func (*Kubeclient) Delete

func (k *Kubeclient) Delete(name string) error

Delete deletes the zfsbkp bkpume from kubernetes

func (*Kubeclient) Get

func (k *Kubeclient) Get(
	name string,
	opts metav1.GetOptions,
) (*apis.ZFSBackup, error)

Get returns zfsbkp bkpume object for given name

func (*Kubeclient) GetRaw

func (k *Kubeclient) GetRaw(
	name string,
	opts metav1.GetOptions,
) ([]byte, error)

GetRaw returns zfsbkp bkpume instance in bytes

func (*Kubeclient) List

List returns a list of zfsbkp bkpume instances present in kubernetes cluster

func (*Kubeclient) Update

func (k *Kubeclient) Update(bkp *apis.ZFSBackup) (*apis.ZFSBackup, error)

Update updates this zfsbkp bkpume instance against kubernetes cluster

func (*Kubeclient) WithNamespace

func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient

WithNamespace sets the provided namespace against this Kubeclient instance

type KubeclientBuildOption

type KubeclientBuildOption func(*Kubeclient)

KubeclientBuildOption defines the abstraction to build a kubeclient instance

func WithClientSet

func WithClientSet(c *clientset.Clientset) KubeclientBuildOption

WithClientSet sets the kubernetes client against the kubeclient instance

func WithKubeConfigPath

func WithKubeConfigPath(path string) KubeclientBuildOption

WithKubeConfigPath sets the kubernetes client against the provided path

func WithNamespace

func WithNamespace(namespace string) KubeclientBuildOption

WithNamespace sets the kubernetes client against the provided namespace

type ListBuilder

type ListBuilder struct {
	// contains filtered or unexported fields
}

ListBuilder enables building an instance of ZFSBackupList

func ListBuilderFrom

func ListBuilderFrom(bkps apis.ZFSBackupList) *ListBuilder

ListBuilderFrom returns a new instance of ListBuilder from API list instance

func NewListBuilder

func NewListBuilder() *ListBuilder

NewListBuilder returns a new instance of ListBuilder

func (*ListBuilder) List

func (b *ListBuilder) List() *apis.ZFSBackupList

List returns the list of pod instances that was built by this builder

func (*ListBuilder) WithFilter

func (b *ListBuilder) WithFilter(pred ...Predicate) *ListBuilder

WithFilter add filters on which the pod has to be filtered

type Predicate

type Predicate func(*ZFSBackup) bool

Predicate defines an abstraction to determine conditional checks against the provided pod instance

func HasLabel

func HasLabel(key, value string) Predicate

HasLabel returns true if provided label is present in the provided ZFSBackup instance

func HasLabels

func HasLabels(keyValuePair map[string]string) Predicate

HasLabels returns true if provided labels are present in the provided ZFSBackup instance

func IsNil

func IsNil() Predicate

IsNil is predicate to filter out nil zfsbkp bkpume instances

type ZFSBackup

type ZFSBackup struct {
	// ZFSSnap object
	Object *apis.ZFSBackup
}

ZFSBackup is a wrapper over ZFSBackup API instance

func From

func From(bkp *apis.ZFSBackup) *ZFSBackup

From returns a new instance of zfsbkp bkpume

func (*ZFSBackup) GetAPIObject

func (bkp *ZFSBackup) GetAPIObject() *apis.ZFSBackup

GetAPIObject returns zfsbkp bkpume's API instance

func (*ZFSBackup) HasLabel

func (bkp *ZFSBackup) HasLabel(key, value string) bool

HasLabel returns true if provided label is present in the provided ZFSBackup instance

func (*ZFSBackup) IsNil

func (bkp *ZFSBackup) IsNil() bool

IsNil returns true if the zfsbkp bkpume instance is nil

type ZFSBackupList

type ZFSBackupList struct {
	// List contains list of backups
	List apis.ZFSBackupList
}

ZFSBackupList holds the list of zfs backup instances

func (*ZFSBackupList) Len

func (bkpList *ZFSBackupList) Len() int

Len returns the number of items present in the ZFSBackupList

Jump to

Keyboard shortcuts

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