Documentation
¶
Index ¶
- Constants
- Variables
- func AreVolumeCapabilitiesCompatible(a, b []*csi.VolumeCapability) (bool, error)
- func CompareVolume(a, b csi.Volume) int
- func EqualVolume(a, b *csi.Volume) bool
- func EqualVolumeCapability(a, b *csi.VolumeCapability) bool
- func GetCSIEndpoint() (network, addr string, err error)
- func GetCSIEndpointListener() (net.Listener, error)
- func IsSuccess(err error, successCodes ...codes.Code) error
- func IsVolumeCapabilityCompatible(a *csi.VolumeCapability, b []*csi.VolumeCapability) (bool, error)
- func NewBlockCapability(mode csi.VolumeCapability_AccessMode_Mode) *csi.VolumeCapability
- func NewMountCapability(mode csi.VolumeCapability_AccessMode_Mode, fsType string, mountFlags ...string) *csi.VolumeCapability
- func PageSnapshots(ctx context.Context, client csi.ControllerClient, req csi.ListSnapshotsRequest, ...) (<-chan csi.Snapshot, <-chan error)
- func PageVolumes(ctx context.Context, client csi.ControllerClient, req csi.ListVolumesRequest, ...) (<-chan csi.Volume, <-chan error)
- func ParseMap(line string) map[string]string
- func ParseMapWS(line string) map[string]string
- func ParseProtoAddr(protoAddr string) (proto string, addr string, err error)
- func ParseSlice(line string) []string
Constants ¶
const ( Kib int64 = 1024 Mib int64 = Kib * 1024 Gib int64 = Mib * 1024 Gib100 int64 = Gib * 100 Tib int64 = Gib * 1024 Tib100 int64 = Tib * 100 )
Volume Sizes
const CSIEndpoint = "CSI_ENDPOINT"
CSIEndpoint is the name of the environment variable that contains the CSI endpoint.
Variables ¶
var ErrParseProtoAddrRequired = errors.New(
"non-empty network address is required")
ErrParseProtoAddrRequired occurs when an empty string is provided to ParseProtoAddr.
Functions ¶
func AreVolumeCapabilitiesCompatible ¶
func AreVolumeCapabilitiesCompatible( a, b []*csi.VolumeCapability, ) (bool, error)
AreVolumeCapabilitiesCompatible returns a flag indicating whether the volume capability array "a" is compatible with "b". A true value indicates that "a" and "b" are equivalent or "b" is a superset of "a".
func CompareVolume ¶
CompareVolume compares two csi.Volume objects and returns a negative number if a < b, a positive number if a > b, and zero if a == b.
func EqualVolume ¶
EqualVolume returns a flag indicating if two csi.Volume objects are equal. If a and b are both nil then false is returned.
func EqualVolumeCapability ¶
func EqualVolumeCapability(a, b *csi.VolumeCapability) bool
EqualVolumeCapability returns a flag indicating if two csi.VolumeCapability objects are equal. If a and b are both nil then false is returned.
func GetCSIEndpoint ¶
GetCSIEndpoint returns the network address specified by the environment variable CSI_ENDPOINT.
func GetCSIEndpointListener ¶
GetCSIEndpointListener returns the net.Listener for the endpoint specified by the environment variable CSI_ENDPOINT.
func IsSuccess ¶
IsSuccess returns nil if the provided error is an RPC error with an error code that is OK (0) or matches one of the additional, provided successful error codes. Otherwise the original error is returned.
func IsVolumeCapabilityCompatible ¶
func IsVolumeCapabilityCompatible( a *csi.VolumeCapability, b []*csi.VolumeCapability, ) (bool, error)
IsVolumeCapabilityCompatible returns a flag indicating whether the volume capability "a" is compatible with the set "b". A true value indicates that "a" and "b" are equivalent or "b" is a superset of "a".
func NewBlockCapability ¶
func NewBlockCapability( mode csi.VolumeCapability_AccessMode_Mode, ) *csi.VolumeCapability
NewBlockCapability returns a new *csi.VolumeCapability for a volume that is to be accessed as a raw device.
func NewMountCapability ¶
func NewMountCapability( mode csi.VolumeCapability_AccessMode_Mode, fsType string, mountFlags ...string, ) *csi.VolumeCapability
NewMountCapability returns a new *csi.VolumeCapability for a volume that is to be mounted.
func PageSnapshots ¶
func PageSnapshots( ctx context.Context, client csi.ControllerClient, req csi.ListSnapshotsRequest, opts ...grpc.CallOption, ) (<-chan csi.Snapshot, <-chan error)
PageSnapshots issues one or more ListSnapshots requests to retrieve all available snaphsots, returning them over a Go channel.
func PageVolumes ¶
func PageVolumes( ctx context.Context, client csi.ControllerClient, req csi.ListVolumesRequest, opts ...grpc.CallOption, ) (<-chan csi.Volume, <-chan error)
PageVolumes issues one or more ListVolumes requests to retrieve all available volumes, returning them over a Go channel.
func ParseMap ¶
ParseMap parses a string into a map. The string's expected pattern is:
KEY1=VAL1, "KEY2=VAL2 ", "KEY 3= VAL3"
The key/value pairs are separated by a comma and optional whitespace. Please see the encoding/csv package (https://goo.gl/1j1xb9) for information on how to quote keys and/or values to include leading and trailing whitespace.
func ParseMapWS ¶
ParseMapWS parses a string into a map. The string's expected pattern is:
KEY1=VAL1 KEY2="VAL2 " "KEY 3"=' VAL3'
The key/value pairs are separated by one or more whitespace characters. Keys and/or values with whitespace should be quoted with either single or double quotes.
func ParseProtoAddr ¶
ParseProtoAddr parses a Golang network address.
func ParseSlice ¶
ParseSlice parses a string into a slice. The string's expected pattern is:
VAL1, "VAL2 ", " VAL3 "
The values are separated by a comma and optional whitespace. Please see the encoding/csv package (https://goo.gl/1j1xb9) for information on how to quote values to include leading and trailing whitespace.
Types ¶
This section is empty.