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 ¶
- 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 RegisterAPIServer(s *grpc.Server, srv APIServer)
- type APIClient
- type APIServer
- type AttachRequest
- func (*AttachRequest) Descriptor() ([]byte, []int)
- func (m *AttachRequest) GetJsonOptions() map[string]string
- func (*AttachRequest) ProtoMessage()
- func (m *AttachRequest) Reset()
- func (m *AttachRequest) String() string
- func (m *AttachRequest) XXX_DiscardUnknown()
- func (m *AttachRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *AttachRequest) XXX_Merge(src proto.Message)
- func (m *AttachRequest) XXX_Size() int
- func (m *AttachRequest) XXX_Unmarshal(b []byte) error
- type Client
- type DetachRequest
- func (*DetachRequest) Descriptor() ([]byte, []int)
- func (m *DetachRequest) GetMountDevice() string
- func (*DetachRequest) ProtoMessage()
- func (m *DetachRequest) Reset()
- func (m *DetachRequest) String() string
- func (m *DetachRequest) XXX_DiscardUnknown()
- func (m *DetachRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *DetachRequest) XXX_Merge(src proto.Message)
- func (m *DetachRequest) XXX_Size() int
- func (m *DetachRequest) XXX_Unmarshal(b []byte) error
- type MountRequest
- func (*MountRequest) Descriptor() ([]byte, []int)
- func (m *MountRequest) GetJsonOptions() map[string]string
- func (m *MountRequest) GetMountDevice() string
- func (m *MountRequest) GetTargetMountDir() string
- func (*MountRequest) ProtoMessage()
- func (m *MountRequest) Reset()
- func (m *MountRequest) String() string
- func (m *MountRequest) XXX_DiscardUnknown()
- func (m *MountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *MountRequest) XXX_Merge(src proto.Message)
- func (m *MountRequest) XXX_Size() int
- func (m *MountRequest) XXX_Unmarshal(b []byte) error
- type UnmountRequest
- func (*UnmountRequest) Descriptor() ([]byte, []int)
- func (m *UnmountRequest) GetMountDir() string
- func (*UnmountRequest) ProtoMessage()
- func (m *UnmountRequest) Reset()
- func (m *UnmountRequest) String() string
- func (m *UnmountRequest) XXX_DiscardUnknown()
- func (m *UnmountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *UnmountRequest) XXX_Merge(src proto.Message)
- func (m *UnmountRequest) XXX_Size() int
- func (m *UnmountRequest) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 ¶
RegisterAPIHandler 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 RegisterAPIServer ¶
Types ¶
type APIClient ¶
type APIClient interface { Init(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) Attach(ctx context.Context, in *AttachRequest, opts ...grpc.CallOption) (*empty.Empty, error) Detach(ctx context.Context, in *DetachRequest, opts ...grpc.CallOption) (*empty.Empty, error) Mount(ctx context.Context, in *MountRequest, opts ...grpc.CallOption) (*empty.Empty, error) Unmount(ctx context.Context, in *UnmountRequest, opts ...grpc.CallOption) (*empty.Empty, error) }
func NewAPIClient ¶
func NewAPIClient(cc *grpc.ClientConn) APIClient
func NewLocalAPIClient ¶
NewLocalAPIClient returns a new APIClient for the given APIServer.
type APIServer ¶
type APIServer interface { Init(context.Context, *empty.Empty) (*empty.Empty, error) Attach(context.Context, *AttachRequest) (*empty.Empty, error) Detach(context.Context, *DetachRequest) (*empty.Empty, error) Mount(context.Context, *MountRequest) (*empty.Empty, error) Unmount(context.Context, *UnmountRequest) (*empty.Empty, error) }
func NewAPIServer ¶
NewAPIServer returns a new APIServer for the given Client.
type AttachRequest ¶
type AttachRequest struct { JsonOptions map[string]string `` /* 161-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AttachRequest) Descriptor ¶
func (*AttachRequest) Descriptor() ([]byte, []int)
func (*AttachRequest) GetJsonOptions ¶
func (m *AttachRequest) GetJsonOptions() map[string]string
func (*AttachRequest) ProtoMessage ¶
func (*AttachRequest) ProtoMessage()
func (*AttachRequest) Reset ¶
func (m *AttachRequest) Reset()
func (*AttachRequest) String ¶
func (m *AttachRequest) String() string
func (*AttachRequest) XXX_DiscardUnknown ¶
func (m *AttachRequest) XXX_DiscardUnknown()
func (*AttachRequest) XXX_Marshal ¶
func (m *AttachRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AttachRequest) XXX_Merge ¶
func (dst *AttachRequest) XXX_Merge(src proto.Message)
func (*AttachRequest) XXX_Size ¶
func (m *AttachRequest) XXX_Size() int
func (*AttachRequest) XXX_Unmarshal ¶
func (m *AttachRequest) XXX_Unmarshal(b []byte) error
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" json:"mount_device,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DetachRequest) Descriptor ¶
func (*DetachRequest) Descriptor() ([]byte, []int)
func (*DetachRequest) GetMountDevice ¶
func (m *DetachRequest) GetMountDevice() string
func (*DetachRequest) ProtoMessage ¶
func (*DetachRequest) ProtoMessage()
func (*DetachRequest) Reset ¶
func (m *DetachRequest) Reset()
func (*DetachRequest) String ¶
func (m *DetachRequest) String() string
func (*DetachRequest) XXX_DiscardUnknown ¶
func (m *DetachRequest) XXX_DiscardUnknown()
func (*DetachRequest) XXX_Marshal ¶
func (m *DetachRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DetachRequest) XXX_Merge ¶
func (dst *DetachRequest) XXX_Merge(src proto.Message)
func (*DetachRequest) XXX_Size ¶
func (m *DetachRequest) XXX_Size() int
func (*DetachRequest) XXX_Unmarshal ¶
func (m *DetachRequest) XXX_Unmarshal(b []byte) error
type MountRequest ¶
type MountRequest struct { TargetMountDir string `protobuf:"bytes,1,opt,name=target_mount_dir,json=targetMountDir" json:"target_mount_dir,omitempty"` MountDevice string `protobuf:"bytes,2,opt,name=mount_device,json=mountDevice" json:"mount_device,omitempty"` JsonOptions map[string]string `` /* 161-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MountRequest) Descriptor ¶
func (*MountRequest) Descriptor() ([]byte, []int)
func (*MountRequest) GetJsonOptions ¶
func (m *MountRequest) GetJsonOptions() map[string]string
func (*MountRequest) GetMountDevice ¶
func (m *MountRequest) GetMountDevice() string
func (*MountRequest) GetTargetMountDir ¶
func (m *MountRequest) GetTargetMountDir() string
func (*MountRequest) ProtoMessage ¶
func (*MountRequest) ProtoMessage()
func (*MountRequest) Reset ¶
func (m *MountRequest) Reset()
func (*MountRequest) String ¶
func (m *MountRequest) String() string
func (*MountRequest) XXX_DiscardUnknown ¶
func (m *MountRequest) XXX_DiscardUnknown()
func (*MountRequest) XXX_Marshal ¶
func (m *MountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MountRequest) XXX_Merge ¶
func (dst *MountRequest) XXX_Merge(src proto.Message)
func (*MountRequest) XXX_Size ¶
func (m *MountRequest) XXX_Size() int
func (*MountRequest) XXX_Unmarshal ¶
func (m *MountRequest) XXX_Unmarshal(b []byte) error
type UnmountRequest ¶
type UnmountRequest struct { MountDir string `protobuf:"bytes,1,opt,name=mount_dir,json=mountDir" json:"mount_dir,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UnmountRequest) Descriptor ¶
func (*UnmountRequest) Descriptor() ([]byte, []int)
func (*UnmountRequest) GetMountDir ¶
func (m *UnmountRequest) GetMountDir() string
func (*UnmountRequest) ProtoMessage ¶
func (*UnmountRequest) ProtoMessage()
func (*UnmountRequest) Reset ¶
func (m *UnmountRequest) Reset()
func (*UnmountRequest) String ¶
func (m *UnmountRequest) String() string
func (*UnmountRequest) XXX_DiscardUnknown ¶
func (m *UnmountRequest) XXX_DiscardUnknown()
func (*UnmountRequest) XXX_Marshal ¶
func (m *UnmountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UnmountRequest) XXX_Merge ¶
func (dst *UnmountRequest) XXX_Merge(src proto.Message)
func (*UnmountRequest) XXX_Size ¶
func (m *UnmountRequest) XXX_Size() int
func (*UnmountRequest) XXX_Unmarshal ¶
func (m *UnmountRequest) XXX_Unmarshal(b []byte) error