Documentation
¶
Index ¶
- func ValidatePathWindows(path string) error
- type CreateSymlinkRequest
- type CreateSymlinkResponse
- type Filesystem
- func (f *Filesystem) CreateSymlink(ctx context.Context, request *CreateSymlinkRequest) (*CreateSymlinkResponse, error)
- func (f *Filesystem) IsSymlink(ctx context.Context, request *IsSymlinkRequest) (*IsSymlinkResponse, error)
- func (f *Filesystem) Mkdir(ctx context.Context, request *MkdirRequest) (*MkdirResponse, error)
- func (f *Filesystem) PathExists(ctx context.Context, request *PathExistsRequest) (*PathExistsResponse, error)
- func (f *Filesystem) PathValid(ctx context.Context, request *PathValidRequest) (*PathValidResponse, error)
- func (f *Filesystem) Rmdir(ctx context.Context, request *RmdirRequest) (*RmdirResponse, error)
- func (f *Filesystem) RmdirContents(ctx context.Context, request *RmdirContentsRequest) (*RmdirContentsResponse, error)
- type Interface
- type IsSymlinkRequest
- type IsSymlinkResponse
- type MkdirRequest
- type MkdirResponse
- type PathExistsRequest
- type PathExistsResponse
- type PathValidRequest
- type PathValidResponse
- type RmdirContentsRequest
- type RmdirContentsResponse
- type RmdirRequest
- type RmdirResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidatePathWindows ¶
Types ¶
type CreateSymlinkRequest ¶
type CreateSymlinkRequest struct {
// The path of the existing directory to be linked.
// All special characters allowed by Windows in path names will be allowed
// except for restrictions noted below. For details, please check:
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
//
// Restrictions:
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
// The path prefix needs needs to match the paths specified as
// kubelet-csi-plugins-path parameter of csi-proxy.
// UNC paths of the form "\\server\share\path\file" are not allowed.
// All directory separators need to be backslash character: "\".
// Characters: .. / : | ? * in the path are not allowed.
// source_path cannot already exist in the host filesystem.
// Maximum path length will be capped to 260 characters.
SourcePath string
// Target path is the location of the new directory entry to be created in the host's filesystem.
// All special characters allowed by Windows in path names will be allowed
// except for restrictions noted below. For details, please check:
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
//
// Restrictions:
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
// The path prefix needs to match the paths specified as
// kubelet-pod-path parameter of csi-proxy.
// UNC paths of the form "\\server\share\path\file" are not allowed.
// All directory separators need to be backslash character: "\".
// Characters: .. / : | ? * in the path are not allowed.
// target_path needs to exist as a directory in the host that is empty.
// target_path cannot be a symbolic link.
// Maximum path length will be capped to 260 characters.
TargetPath string
}
type CreateSymlinkResponse ¶
type CreateSymlinkResponse struct {
}
type Filesystem ¶
type Filesystem struct {
// contains filtered or unexported fields
}
func New ¶
func New(hostAPI filesystemapi.HostAPI) (*Filesystem, error)
func (*Filesystem) CreateSymlink ¶
func (f *Filesystem) CreateSymlink(ctx context.Context, request *CreateSymlinkRequest) (*CreateSymlinkResponse, error)
func (*Filesystem) IsSymlink ¶
func (f *Filesystem) IsSymlink(ctx context.Context, request *IsSymlinkRequest) (*IsSymlinkResponse, error)
func (*Filesystem) Mkdir ¶
func (f *Filesystem) Mkdir(ctx context.Context, request *MkdirRequest) (*MkdirResponse, error)
func (*Filesystem) PathExists ¶
func (f *Filesystem) PathExists(ctx context.Context, request *PathExistsRequest) (*PathExistsResponse, error)
PathExists checks if the given path exists on the host.
func (*Filesystem) PathValid ¶
func (f *Filesystem) PathValid(ctx context.Context, request *PathValidRequest) (*PathValidResponse, error)
func (*Filesystem) Rmdir ¶
func (f *Filesystem) Rmdir(ctx context.Context, request *RmdirRequest) (*RmdirResponse, error)
func (*Filesystem) RmdirContents ¶
func (f *Filesystem) RmdirContents(ctx context.Context, request *RmdirContentsRequest) (*RmdirContentsResponse, error)
type Interface ¶
type Interface interface {
// CreateSymlink creates a symbolic link called target_path that points to source_path
// in the host filesystem (target_path is the name of the symbolic link created,
// source_path is the existing path).
CreateSymlink(context.Context, *CreateSymlinkRequest) (*CreateSymlinkResponse, error)
// IsSymlink checks if a given path is a symlink.
IsSymlink(context.Context, *IsSymlinkRequest) (*IsSymlinkResponse, error)
// Mkdir creates a directory at the requested path in the host filesystem.
Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error)
// PathExists checks if the requested path exists in the host filesystem.
PathExists(context.Context, *PathExistsRequest) (*PathExistsResponse, error)
// PathValid checks if the given path is accessible.
PathValid(context.Context, *PathValidRequest) (*PathValidResponse, error)
// Rmdir removes the directory at the requested path in the host filesystem.
// This may be used for unlinking a symlink created through CreateSymlink.
Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error)
// RmdirContents removes the contents of a directory in the host filesystem.
// Unlike Rmdir it won't delete the requested path, it'll only delete its contents.
RmdirContents(context.Context, *RmdirContentsRequest) (*RmdirContentsResponse, error)
}
type IsSymlinkRequest ¶
type IsSymlinkRequest struct {
// The path whose existence as a symlink we want to check in the host's filesystem
Path string
}
type IsSymlinkResponse ¶
type IsSymlinkResponse struct {
// Indicates whether the path in IsSymlinkRequest is a symlink
IsSymlink bool
}
type MkdirRequest ¶
type MkdirRequest struct {
// The path to create in the host's filesystem.
// All special characters allowed by Windows in path names will be allowed
// except for restrictions noted below. For details, please check:
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
// Non-existent parent directories in the path will be automatically created.
// Directories will be created with Read and Write privileges of the Windows
// User account under which csi-proxy is started (typically LocalSystem).
//
// Restrictions:
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
// Depending on the context parameter of this function, the path prefix needs
// to match the paths specified either as kubelet-csi-plugins-path
// or as kubelet-pod-path parameters of csi-proxy.
// The path parameter cannot already exist on host filesystem.
// UNC paths of the form "\\server\share\path\file" are not allowed.
// All directory separators need to be backslash character: "\".
// Characters: .. / : | ? * in the path are not allowed.
// Maximum path length will be capped to 260 characters.
Path string
}
type MkdirResponse ¶
type MkdirResponse struct {
}
type PathExistsRequest ¶
type PathExistsRequest struct {
// The path whose existence we want to check in the host's filesystem
Path string
}
type PathExistsResponse ¶
type PathExistsResponse struct {
// Indicates whether the path in PathExistsRequest exists in the host's filesystem
Exists bool
}
type PathValidRequest ¶
type PathValidRequest struct {
// The path whose validity we want to check in the host's filesystem
Path string
}
type PathValidResponse ¶
type PathValidResponse struct {
// Indicates whether the path in PathValidRequest is a valid path
Valid bool
}
type RmdirContentsRequest ¶
type RmdirContentsRequest struct {
// The path to remove in the host's filesystem.
// All special characters allowed by Windows in path names will be allowed
// except for restrictions noted below. For details, please check:
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
//
// Restrictions:
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
// Depending on the context parameter of this function, the path prefix needs
// to match the paths specified either as kubelet-csi-plugins-path
// or as kubelet-pod-path parameters of csi-proxy.
// UNC paths of the form "\\server\share\path\file" are not allowed.
// All directory separators need to be backslash character: "\".
// Characters: .. / : | ? * in the path are not allowed.
// Path cannot be a file of type symlink.
// Maximum path length will be capped to 260 characters.
Path string
}
type RmdirContentsResponse ¶
type RmdirContentsResponse struct {
}
type RmdirRequest ¶
type RmdirRequest struct {
// The path to remove in the host's filesystem.
// All special characters allowed by Windows in path names will be allowed
// except for restrictions noted below. For details, please check:
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
//
// Restrictions:
// Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted.
// Depending on the context parameter of this function, the path prefix needs
// to match the paths specified either as kubelet-csi-plugins-path
// or as kubelet-pod-path parameters of csi-proxy.
// UNC paths of the form "\\server\share\path\file" are not allowed.
// All directory separators need to be backslash character: "\".
// Characters: .. / : | ? * in the path are not allowed.
// Path cannot be a file of type symlink.
// Maximum path length will be capped to 260 characters.
Path string
// Force remove all contents under path (if any).
Force bool
}
type RmdirResponse ¶
type RmdirResponse struct {
}
Click to show internal directories.
Click to hide internal directories.