snapbuilder

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 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 ZFSSnapshot

func BuildFrom

func BuildFrom(snap *apis.ZFSSnapshot) *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.ZFSSnapshot, error)

Build returns ZFSSnapshot API object

func (*Builder) WithFinalizer

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

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 ZFSSnapshot

func (*Builder) WithNamespace

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

WithNamespace sets the namespace of ZFSSnapshot

type Kubeclient

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

Kubeclient enables kubernetes API operations on zfssnap volume instance

func NewKubeclient

func NewKubeclient(opts ...KubeclientBuildOption) *Kubeclient

NewKubeclient returns a new instance of kubeclient meant for zfssnap volume operations

func (*Kubeclient) Create

func (k *Kubeclient) Create(vol *apis.ZFSSnapshot) (*apis.ZFSSnapshot, error)

Create creates a zfssnap volume instance in kubernetes cluster

func (*Kubeclient) Delete

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

Delete deletes the zfssnap volume from kubernetes

func (*Kubeclient) Get

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

Get returns zfssnap volume object for given name

func (*Kubeclient) GetRaw

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

GetRaw returns zfssnap volume instance in bytes

func (*Kubeclient) List

List returns a list of zfssnap volume instances present in kubernetes cluster

func (*Kubeclient) Update

func (k *Kubeclient) Update(vol *apis.ZFSSnapshot) (*apis.ZFSSnapshot, error)

Update updates this zfssnap volume 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 ZFSSnapshotList

func ListBuilderFrom

func ListBuilderFrom(vols apis.ZFSSnapshotList) *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.ZFSSnapshotList

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(*ZFSSnapshot) 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 ZFSSnapshot instance

func HasLabels

func HasLabels(keyValuePair map[string]string) Predicate

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

func IsNil

func IsNil() Predicate

IsNil is predicate to filter out nil zfssnap volume instances

type ZFSSnapshot

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

ZFSSnapshot is a wrapper over ZFSSnapshot API instance

func From

func From(snap *apis.ZFSSnapshot) *ZFSSnapshot

From returns a new instance of zfssnap volume

func (*ZFSSnapshot) GetAPIObject

func (snap *ZFSSnapshot) GetAPIObject() *apis.ZFSSnapshot

GetAPIObject returns zfssnap volume's API instance

func (*ZFSSnapshot) HasLabel

func (snap *ZFSSnapshot) HasLabel(key, value string) bool

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

func (*ZFSSnapshot) IsNil

func (snap *ZFSSnapshot) IsNil() bool

IsNil returns true if the zfssnap volume instance is nil

type ZFSSnapshotList

type ZFSSnapshotList struct {
	// List contains list of snapshots
	List apis.ZFSSnapshotList
}

ZFSSnapshotList holds the list of zfs snapshot instances

func (*ZFSSnapshotList) Len

func (snapList *ZFSSnapshotList) Len() int

Len returns the number of items present in the ZFSSnapshotList

Jump to

Keyboard shortcuts

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