service

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultBackOff = wait.Backoff{
		Duration: time.Second,
		Factor:   1.5,
		Steps:    20,
		Cap:      time.Minute * 2,
	}
)

Functions

func GetInstanceIdFromFile

func GetInstanceIdFromFile(filepath string) (instanceId string, err error)

func GetRequiredVolumeSizeByte

func GetRequiredVolumeSizeByte(capRange *csi.CapacityRange) (int64, error)

Required Volume Size

func Run

func Run(option *Option, storageProvider storage.Provider, endpoint string)

Run Initial and start CSI driver

Types

type NonBlockingGRPCServer

type NonBlockingGRPCServer interface {
	// Start services at the endpoint
	Start(endpoint string, service Service)
	// Waits for the service to stop
	Wait()
	// Stops the service gracefully
	Stop()
	// Stops the service forcefully
	ForceStop()
}

Defines Non blocking GRPC server interfaces

func NewNonBlockingGRPCServer

func NewNonBlockingGRPCServer() NonBlockingGRPCServer

type Option

type Option struct {
	Name          string
	Version       string
	NodeId        string
	MaxVolume     int64
	VolumeCap     []*csi.VolumeCapability_AccessMode
	ControllerCap []*csi.ControllerServiceCapability
	NodeCap       []*csi.NodeServiceCapability
	NodeCapType   []csi.NodeServiceCapability_RPC_Type
	PluginCap     []*csi.PluginCapability

	RetryTime wait.Backoff
}

func NewOption

func NewOption() *Option

NewOption

func (*Option) SetControllerServiceCapabilities

func (o *Option) SetControllerServiceCapabilities(cl []csi.ControllerServiceCapability_RPC_Type) *Option

func (*Option) SetMaxVolume

func (o *Option) SetMaxVolume(maxVolume int64) *Option

func (*Option) SetName

func (o *Option) SetName(name string) *Option

func (*Option) SetNodeId

func (o *Option) SetNodeId(nodeId string) *Option

func (*Option) SetNodeServiceCapabilities

func (o *Option) SetNodeServiceCapabilities(nl []csi.NodeServiceCapability_RPC_Type) *Option

func (*Option) SetPluginCapabilities

func (o *Option) SetPluginCapabilities(cap []*csi.PluginCapability) *Option

func (*Option) SetRetryTime

func (o *Option) SetRetryTime(retryTime wait.Backoff) *Option

func (*Option) SetVersion

func (o *Option) SetVersion(version string) *Option

func (*Option) SetVolumeCapabilityAccessNodes

func (o *Option) SetVolumeCapabilityAccessNodes(vc []csi.VolumeCapability_AccessMode_Mode) *Option

func (*Option) ValidateVolumeAccessMode

func (o *Option) ValidateVolumeAccessMode(c csi.VolumeCapability_AccessMode_Mode) bool

func (*Option) ValidateVolumeCapabilities

func (o *Option) ValidateVolumeCapabilities(caps []*csi.VolumeCapability) bool

func (*Option) ValidateVolumeCapability

func (o *Option) ValidateVolumeCapability(cap *csi.VolumeCapability) bool

type Service

type Service interface {
	csi.ControllerServer
	csi.IdentityServer
	csi.NodeServer
	Interceptor() grpc.UnaryServerInterceptor
}

func New

func New(option *Option, cloud storage.Provider) Service

Jump to

Keyboard shortcuts

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