Documentation
¶
Index ¶
- Constants
- Variables
- func AreVolumeCapabilitiesCompatible(a, b []*csi.VolumeCapability) (bool, error)
- func ChainUnaryClient(i ...grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor
- func ChainUnaryServer(i ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
- func CompareVersions(a, b *csi.Version) int8
- func CompareVolumeInfo(a, b csi.VolumeInfo) int
- func EqualVolumeCapability(a, b *csi.VolumeCapability) bool
- func EqualVolumeInfo(a, b *csi.VolumeInfo) bool
- func FprintfVersion(w io.Writer, v csi.Version) (int, error)
- func GetCSIEndpoint() (network, addr string, err error)
- func GetCSIEndpointListener() (net.Listener, error)
- func IsNilResponse(method string, rep interface{}) bool
- func IsSuccess(err error, successCodes ...codes.Code) error
- func IsSuccessfulResponse(method string, err error) 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 PageVolumes(ctx context.Context, client csi.ControllerClient, req csi.ListVolumesRequest, ...) (<-chan csi.VolumeInfo, <-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
- func ParseVersion(s string) (csi.Version, bool)
- func ParseVersions(s string) []csi.Version
- func SprintfVersion(v csi.Version) string
Constants ¶
const ( // Namespace is the namesapce used by the protobuf. Namespace = "csi" // CSIEndpoint is the name of the environment variable that // contains the CSI endpoint. CSIEndpoint = "CSI_ENDPOINT" // CreateVolume is the full method name for the // eponymous RPC message. CreateVolume = ctrlSvc + "CreateVolume" // DeleteVolume is the full method name for the // eponymous RPC message. DeleteVolume = ctrlSvc + "DeleteVolume" // ControllerPublishVolume is the full method name for the // eponymous RPC message. ControllerPublishVolume = ctrlSvc + "ControllerPublishVolume" // ControllerUnpublishVolume is the full method name for the // eponymous RPC message. ControllerUnpublishVolume = ctrlSvc + "ControllerUnpublishVolume" // ValidateVolumeCapabilities is the full method name for the // eponymous RPC message. ValidateVolumeCapabilities = ctrlSvc + "ValidateVolumeCapabilities" // ListVolumes is the full method name for the // eponymous RPC message. ListVolumes = ctrlSvc + "ListVolumes" // GetCapacity is the full method name for the // eponymous RPC message. GetCapacity = ctrlSvc + "GetCapacity" // ControllerGetCapabilities is the full method name for the // eponymous RPC message. ControllerGetCapabilities = ctrlSvc + "ControllerGetCapabilities" // ControllerProbe is the full method name for the // eponymous RPC message. ControllerProbe = ctrlSvc + "ControllerProbe" // GetSupportedVersions is the full method name for the // eponymous RPC message. GetSupportedVersions = identSvc + "GetSupportedVersions" // GetPluginInfo is the full method name for the // eponymous RPC message. GetPluginInfo = identSvc + "GetPluginInfo" // GetNodeID is the full method name for the // eponymous RPC message. GetNodeID = nodeSvc + "GetNodeID" // NodePublishVolume is the full method name for the // eponymous RPC message. NodePublishVolume = nodeSvc + "NodePublishVolume" // NodeUnpublishVolume is the full method name for the // eponymous RPC message. NodeUnpublishVolume = nodeSvc + "NodeUnpublishVolume" // NodeProbe is the full method name for the // eponymous RPC message. NodeProbe = nodeSvc + "NodeProbe" // NodeGetCapabilities is the full method name for the // eponymous RPC message. NodeGetCapabilities = nodeSvc + "NodeGetCapabilities" )
Variables ¶
var ErrParseProtoAddrRequired = errors.New(
"non-empty network address is required")
ErrParseProtoAddrRequired occurs when an empty string is provided to ParseProtoAddr.
Functions ¶
func AreVolumeCapabilitiesCompatible ¶ added in v0.3.2
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 ChainUnaryClient ¶
func ChainUnaryClient( i ...grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor
ChainUnaryClient chains one or more unary, client interceptors together into a left-to-right series that can be provided to a new gRPC client.
func ChainUnaryServer ¶
func ChainUnaryServer( i ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
ChainUnaryServer chains one or more unary, server interceptors together into a left-to-right series that can be provided to a new gRPC server.
func CompareVersions ¶
CompareVersions compares two versions and returns:
-1 if a > b 0 if a = b 1 if a < b
func CompareVolumeInfo ¶ added in v0.3.2
func CompareVolumeInfo(a, b csi.VolumeInfo) int
CompareVolumeInfo compares two csi.VolumeInfo objects and returns a negative number if a < b, a positive number if a > b, and zero if a == b.
func EqualVolumeCapability ¶ added in v0.3.2
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 EqualVolumeInfo ¶ added in v0.3.2
func EqualVolumeInfo(a, b *csi.VolumeInfo) bool
EqualVolumeInfo returns a flag indicating if two csi.VolumeInfo objects are equal. If a and b are both nil then false is returned.
func FprintfVersion ¶
FprintfVersion formats a Version as a string to the specified writer.
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 IsNilResponse ¶
IsNilResponse returns a flag indicating whether or not the provided response object is a nil object wrapped inside a non-nil interface.
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 IsSuccessfulResponse ¶
IsSuccessfulResponse uses IsSuccess to determine if the response for a specific CSI method is successful. If successful a nil value is returned; otherwise the original error is returned.
func IsVolumeCapabilityCompatible ¶ added in v0.3.2
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 PageVolumes ¶
func PageVolumes( ctx context.Context, client csi.ControllerClient, req csi.ListVolumesRequest, opts ...grpc.CallOption) (<-chan csi.VolumeInfo, <-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.
func ParseVersion ¶
ParseVersion parses a string for a CSI version.
func ParseVersions ¶
ParseVersions parses a string for one or more CSI versions.
func SprintfVersion ¶
SprintfVersion formats a Version as a string.
Types ¶
This section is empty.