Documentation ¶
Overview ¶
Package flexvolume implements utility code for Kubernetes flexvolumes.
https://github.com/kubernetes/kubernetes/pull/13840 https://github.com/kubernetes/kubernetes/tree/master/examples/flexvolume
Package flexvolume is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func BytesToJSONOptions(value []byte) (map[string]string, error)
- func JSONOptionsToBytes(jsonOptions map[string]string) ([]byte, error)
- func RegisterAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client APIClient) error
- func RegisterAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server APIServer) error
- func RegisterAPIServer(s *grpc.Server, srv APIServer)
- type APIClient
- type APIServer
- type AttachRequest
- type Client
- type DetachRequest
- type MountRequest
- func (*MountRequest) Descriptor() ([]byte, []int)deprecated
- func (x *MountRequest) GetJsonOptions() map[string]string
- func (x *MountRequest) GetMountDevice() string
- func (x *MountRequest) GetTargetMountDir() string
- func (*MountRequest) ProtoMessage()
- func (x *MountRequest) ProtoReflect() protoreflect.Message
- func (x *MountRequest) Reset()
- func (x *MountRequest) String() string
- type UnimplementedAPIServer
- func (*UnimplementedAPIServer) Attach(context.Context, *AttachRequest) (*emptypb.Empty, error)
- func (*UnimplementedAPIServer) Detach(context.Context, *DetachRequest) (*emptypb.Empty, error)
- func (*UnimplementedAPIServer) Init(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (*UnimplementedAPIServer) Mount(context.Context, *MountRequest) (*emptypb.Empty, error)
- func (*UnimplementedAPIServer) Unmount(context.Context, *UnmountRequest) (*emptypb.Empty, error)
- type UnmountRequest
Constants ¶
This section is empty.
Variables ¶
var File_pkg_flexvolume_flexvolume_proto protoreflect.FileDescriptor
Functions ¶
func BytesToJSONOptions ¶
BytesToJSONOptions converts a JSON string to a map of JSON options.
func JSONOptionsToBytes ¶
JSONOptionsToBytes converts a map of JSON Options to a JSON string.
func RegisterAPIHandler ¶
RegisterAPIHandler registers the http handlers for service API to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAPIHandlerClient ¶
RegisterAPIHandlerClient registers the http handlers for service API to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "APIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "APIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "APIClient" to call the correct interceptors.
func RegisterAPIHandlerFromEndpoint ¶
func RegisterAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAPIHandlerFromEndpoint is same as RegisterAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAPIHandlerServer ¶
RegisterAPIHandlerServer registers the http handlers for service API to "mux". UnaryRPC :call APIServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAPIHandlerFromEndpoint instead.
func RegisterAPIServer ¶
Types ¶
type APIClient ¶
type APIClient interface { Init(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) Attach(ctx context.Context, in *AttachRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Detach(ctx context.Context, in *DetachRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Mount(ctx context.Context, in *MountRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Unmount(ctx context.Context, in *UnmountRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
APIClient is the client API for API service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewAPIClient ¶
func NewAPIClient(cc grpc.ClientConnInterface) APIClient
func NewLocalAPIClient ¶
NewLocalAPIClient returns a new APIClient for the given APIServer.
type APIServer ¶
type APIServer interface { Init(context.Context, *emptypb.Empty) (*emptypb.Empty, error) Attach(context.Context, *AttachRequest) (*emptypb.Empty, error) Detach(context.Context, *DetachRequest) (*emptypb.Empty, error) Mount(context.Context, *MountRequest) (*emptypb.Empty, error) Unmount(context.Context, *UnmountRequest) (*emptypb.Empty, error) }
APIServer is the server API for API service.
func NewAPIServer ¶
NewAPIServer returns a new APIServer for the given Client.
type AttachRequest ¶
type AttachRequest struct { JsonOptions map[string]string `` /* 182-byte string literal not displayed */ // contains filtered or unexported fields }
func (*AttachRequest) Descriptor
deprecated
func (*AttachRequest) Descriptor() ([]byte, []int)
Deprecated: Use AttachRequest.ProtoReflect.Descriptor instead.
func (*AttachRequest) GetJsonOptions ¶
func (x *AttachRequest) GetJsonOptions() map[string]string
func (*AttachRequest) ProtoMessage ¶
func (*AttachRequest) ProtoMessage()
func (*AttachRequest) ProtoReflect ¶
func (x *AttachRequest) ProtoReflect() protoreflect.Message
func (*AttachRequest) Reset ¶
func (x *AttachRequest) Reset()
func (*AttachRequest) String ¶
func (x *AttachRequest) String() string
type Client ¶
type Client interface { Init() error Attach(jsonOptions map[string]string) error Detach(mountDevice string, options map[string]string) error Mount(targetMountDir string, mountDevice string, jsonOptions map[string]string) error Unmount(mountDir string, options map[string]string) error }
Client is the client for a flexvolume implementation.
It is both called from the wrapper cli tool, and implemented by a given implementation.
type DetachRequest ¶
type DetachRequest struct { MountDevice string `protobuf:"bytes,1,opt,name=mount_device,json=mountDevice,proto3" json:"mount_device,omitempty"` // contains filtered or unexported fields }
func (*DetachRequest) Descriptor
deprecated
func (*DetachRequest) Descriptor() ([]byte, []int)
Deprecated: Use DetachRequest.ProtoReflect.Descriptor instead.
func (*DetachRequest) GetMountDevice ¶
func (x *DetachRequest) GetMountDevice() string
func (*DetachRequest) ProtoMessage ¶
func (*DetachRequest) ProtoMessage()
func (*DetachRequest) ProtoReflect ¶
func (x *DetachRequest) ProtoReflect() protoreflect.Message
func (*DetachRequest) Reset ¶
func (x *DetachRequest) Reset()
func (*DetachRequest) String ¶
func (x *DetachRequest) String() string
type MountRequest ¶
type MountRequest struct { TargetMountDir string `protobuf:"bytes,1,opt,name=target_mount_dir,json=targetMountDir,proto3" json:"target_mount_dir,omitempty"` MountDevice string `protobuf:"bytes,2,opt,name=mount_device,json=mountDevice,proto3" json:"mount_device,omitempty"` JsonOptions map[string]string `` /* 182-byte string literal not displayed */ // contains filtered or unexported fields }
func (*MountRequest) Descriptor
deprecated
func (*MountRequest) Descriptor() ([]byte, []int)
Deprecated: Use MountRequest.ProtoReflect.Descriptor instead.
func (*MountRequest) GetJsonOptions ¶
func (x *MountRequest) GetJsonOptions() map[string]string
func (*MountRequest) GetMountDevice ¶
func (x *MountRequest) GetMountDevice() string
func (*MountRequest) GetTargetMountDir ¶
func (x *MountRequest) GetTargetMountDir() string
func (*MountRequest) ProtoMessage ¶
func (*MountRequest) ProtoMessage()
func (*MountRequest) ProtoReflect ¶
func (x *MountRequest) ProtoReflect() protoreflect.Message
func (*MountRequest) Reset ¶
func (x *MountRequest) Reset()
func (*MountRequest) String ¶
func (x *MountRequest) String() string
type UnimplementedAPIServer ¶
type UnimplementedAPIServer struct { }
UnimplementedAPIServer can be embedded to have forward compatible implementations.
func (*UnimplementedAPIServer) Attach ¶
func (*UnimplementedAPIServer) Attach(context.Context, *AttachRequest) (*emptypb.Empty, error)
func (*UnimplementedAPIServer) Detach ¶
func (*UnimplementedAPIServer) Detach(context.Context, *DetachRequest) (*emptypb.Empty, error)
func (*UnimplementedAPIServer) Mount ¶
func (*UnimplementedAPIServer) Mount(context.Context, *MountRequest) (*emptypb.Empty, error)
func (*UnimplementedAPIServer) Unmount ¶
func (*UnimplementedAPIServer) Unmount(context.Context, *UnmountRequest) (*emptypb.Empty, error)
type UnmountRequest ¶
type UnmountRequest struct { MountDir string `protobuf:"bytes,1,opt,name=mount_dir,json=mountDir,proto3" json:"mount_dir,omitempty"` // contains filtered or unexported fields }
func (*UnmountRequest) Descriptor
deprecated
func (*UnmountRequest) Descriptor() ([]byte, []int)
Deprecated: Use UnmountRequest.ProtoReflect.Descriptor instead.
func (*UnmountRequest) GetMountDir ¶
func (x *UnmountRequest) GetMountDir() string
func (*UnmountRequest) ProtoMessage ¶
func (*UnmountRequest) ProtoMessage()
func (*UnmountRequest) ProtoReflect ¶
func (x *UnmountRequest) ProtoReflect() protoreflect.Message
func (*UnmountRequest) Reset ¶
func (x *UnmountRequest) Reset()
func (*UnmountRequest) String ¶
func (x *UnmountRequest) String() string