volume

package
v1.11.0-RC2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Overview

Package volume contains specific implementation of cas template engine

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCount

func ByteCount(b uint64) string

ByteCount converts bytes into corresponding unit

Types

type Engine

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

Engine is capable of executing CAS volume related operation via CAS template

func NewVolumeEngine

func NewVolumeEngine(
	casConfigPVC string,
	casConfigSC string,
	castObj *v1alpha1.CASTemplate,
	key string,
	volumeValues map[string]interface{}) (e *Engine, err error)

NewVolumeEngine returns a new instance of casVolumeEngine based on the provided cas configs & volume runtime values

NOTE:

volume runtime values set at **runtime**

by openebs storage provisioner (a kubernetes dynamic storage provisioner)

func (*Engine) Run

func (c *Engine) Run() (op []byte, err error)

Run executes a CAS volume related operation

type ListOperation

type ListOperation struct {
	// OperationOptions has the options to various volume related
	// operations
	OperationOptions
	// contains filtered or unexported fields
}

ListOperation exposes methods to execute volume list operation

func NewListOperation

func NewListOperation(volumes *v1alpha1.CASVolumeList) (*ListOperation, error)

NewListOperation returns a new instance of ListOperation that is capable of listing volumes

func (*ListOperation) List

func (v *ListOperation) List() (*v1alpha1.CASVolumeList, error)

List returns a list of CASVolumeList

type Operation

type Operation struct {
	// OperationOptions has the options to various volume related
	// operations
	OperationOptions
	// contains filtered or unexported fields
}

Operation exposes methods with respect to volume related operations e.g. read, create, delete.

func NewOperation

func NewOperation(volume *v1alpha1.CASVolume) (*Operation, error)

NewOperation returns a new instance of volumeOperation

func (*Operation) Create

func (v *Operation) Create() (*v1alpha1.CASVolume, error)

Create provisions an OpenEBS volume

func (*Operation) Delete

func (v *Operation) Delete() (*v1alpha1.CASVolume, error)

Delete removes a CASVolume

func (*Operation) Read

func (v *Operation) Read() (*v1alpha1.CASVolume, error)

Get the openebs volume details

func (*Operation) ReadStats

func (v *Operation) ReadStats() ([]byte, error)

ReadStats ...

type OperationOptions

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

OperationOptions contains the options with respect to volume related operations

Jump to

Keyboard shortcuts

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