nodebuilder

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 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 Builder

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

Builder is the builder object for DeviceNode

func BuildFrom

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

Build returns DeviceNode API object

func (*Builder) WithDevices

func (b *Builder) WithDevices(devices []apis.Device) *Builder

WithDevices sets the devices of DeviceNode

func (*Builder) WithName

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

WithName sets the name of DeviceNode

func (*Builder) WithNamespace

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

WithNamespace sets the namespace of DeviceNode

func (*Builder) WithOwnerReferences

func (b *Builder) WithOwnerReferences(ownerRefs ...metav1.OwnerReference) *Builder

WithOwnerReferences sets the owner references of DeviceNode

type DeviceNode

type DeviceNode struct {
	// DeviceVolume object
	Object *apis.DeviceNode
}

DeviceNode is a wrapper over DeviceNode API instance

func From

func From(node *apis.DeviceNode) *DeviceNode

From returns a new instance of device volume

type Kubeclient

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

Kubeclient enables kubernetes API operations on device node instance

func NewKubeclient

func NewKubeclient(opts ...KubeclientBuildOption) *Kubeclient

NewKubeclient returns a new instance of kubeclient meant for device node operations

func (*Kubeclient) Create

func (k *Kubeclient) Create(node *apis.DeviceNode) (*apis.DeviceNode, error)

Create creates a device node instance in kubernetes cluster

func (*Kubeclient) Delete

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

Delete deletes the device node from kubernetes

func (*Kubeclient) Get

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

Get returns device node object for given name

func (*Kubeclient) GetRaw

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

GetRaw returns device node instance in bytes

func (*Kubeclient) List

List returns a list of device node instances present in kubernetes cluster

func (*Kubeclient) Update

func (k *Kubeclient) Update(node *apis.DeviceNode) (*apis.DeviceNode, error)

Update updates this device node 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

Jump to

Keyboard shortcuts

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