cmd

package
v0.0.0-...-27c8816 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NOTE Assume that the remote pod run on linux
	S_IFBLK  = 0x6000
	S_IFCHR  = 0x2000
	S_IFDIR  = 0x4000
	S_IFIFO  = 0x1000
	S_IFLNK  = 0xa000
	S_IFMT   = 0xf000
	S_IFREG  = 0x8000
	S_IFSOCK = 0xc000
)

Variables

This section is empty.

Functions

func NewCmdMount

func NewCmdMount(streams genericclioptions.IOStreams) *cobra.Command

NewCmdMount provides a cobra command wrapping MountOptions

func Readlink(fsys fs.FS, name string) (string, error)

Types

type Executor

type Executor interface {
	Run(ctx context.Context, command []string) ([]byte, error)
	RunRead(ctx context.Context, command []string) (io.ReadCloser, error)
}

type LinuxStat_t

type LinuxStat_t struct {
	Dev     uint64
	Ino     uint64
	Nlink   uint64
	Mode    uint32
	Uid     uint32
	Gid     uint32
	Rdev    uint64
	Size    int64
	Blksize int64
	Blocks  int64
	Atim    syscall.Timespec
	Mtim    syscall.Timespec
	Ctim    syscall.Timespec
}

type MountOptions

type MountOptions struct {
	User          string
	PodName       string
	RemoteDir     string
	MountPoint    string
	Namespace     string
	ContainerName string
	Debug         bool

	genericclioptions.IOStreams
	// contains filtered or unexported fields
}

func NewMountOptions

func NewMountOptions(streams genericclioptions.IOStreams) *MountOptions

func (*MountOptions) Complete

func (o *MountOptions) Complete(c *cobra.Command, args []string) error

func (*MountOptions) RunMount

func (o *MountOptions) RunMount(ctx context.Context) error

Run mounts a pod or pods on the resources

type PodDirEntry

type PodDirEntry struct {
	// contains filtered or unexported fields
}

func (*PodDirEntry) Info

func (e *PodDirEntry) Info() (fs.FileInfo, error)

func (*PodDirEntry) IsDir

func (e *PodDirEntry) IsDir() bool

func (*PodDirEntry) Name

func (e *PodDirEntry) Name() string

func (*PodDirEntry) Type

func (e *PodDirEntry) Type() fs.FileMode

type PodExecutor

type PodExecutor struct {
	Namespace     string
	PodName       string
	ContainerName string

	Config     *restclient.Config
	RestClient *restclient.RESTClient
}

func (*PodExecutor) Run

func (e *PodExecutor) Run(ctx context.Context, command []string) ([]byte, error)

func (*PodExecutor) RunRead

func (e *PodExecutor) RunRead(ctx context.Context, command []string) (io.ReadCloser, error)

type PodFS

type PodFS struct {
	Executor Executor
	Pwd      string
}

func (*PodFS) Open

func (f *PodFS) Open(name string) (fs.File, error)

func (*PodFS) ReadDir

func (f *PodFS) ReadDir(name string) ([]fs.DirEntry, error)
func (f *PodFS) Readlink(name string) (string, error)

func (*PodFS) Stat

func (f *PodFS) Stat(name string) (fs.FileInfo, error)

func (*PodFS) Sub

func (f *PodFS) Sub(dir string) (fs.FS, error)

type PodFile

type PodFile struct {
	// contains filtered or unexported fields
}

func (*PodFile) Close

func (f *PodFile) Close() error

func (*PodFile) Read

func (f *PodFile) Read(b []byte) (int, error)

func (*PodFile) Stat

func (f *PodFile) Stat() (fs.FileInfo, error)

type PodFileInfo

type PodFileInfo struct {
	// contains filtered or unexported fields
}

func (*PodFileInfo) IsDir

func (i *PodFileInfo) IsDir() bool

func (*PodFileInfo) ModTime

func (i *PodFileInfo) ModTime() time.Time

func (*PodFileInfo) Mode

func (i *PodFileInfo) Mode() fs.FileMode

func (*PodFileInfo) Name

func (i *PodFileInfo) Name() string

func (*PodFileInfo) Size

func (i *PodFileInfo) Size() int64

func (*PodFileInfo) Sys

func (i *PodFileInfo) Sys() interface{}

type PodFuseNode

type PodFuseNode struct {
	fusefs.Inode
	// contains filtered or unexported fields
}

func (*PodFuseNode) Getattr

func (f *PodFuseNode) Link(ctx context.Context, target fusefs.InodeEmbedder, name string, out *fuse.EntryOut) (node *fusefs.Inode, errno syscall.Errno)

func (*PodFuseNode) Lookup

func (n *PodFuseNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fusefs.Inode, syscall.Errno)

func (*PodFuseNode) Mkdir

func (f *PodFuseNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fusefs.Inode, syscall.Errno)

func (*PodFuseNode) Mknod

func (f *PodFuseNode) Mknod(ctx context.Context, name string, mode uint32, dev uint32, out *fuse.EntryOut) (*fusefs.Inode, syscall.Errno)

func (*PodFuseNode) Open

func (f *PodFuseNode) Open(ctx context.Context, flags uint32) (fh fusefs.FileHandle, fuseFlags uint32, errno syscall.Errno)

func (*PodFuseNode) Read

func (f *PodFuseNode) Read(ctx context.Context, h fusefs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)

func (*PodFuseNode) Readdir

func (f *PodFuseNode) Readlink(ctx context.Context) ([]byte, syscall.Errno)

func (*PodFuseNode) Release

func (*PodFuseNode) Setattr

func (f *PodFuseNode) Symlink(ctx context.Context, target, name string, out *fuse.EntryOut) (node *fusefs.Inode, errno syscall.Errno)
func (f *PodFuseNode) Unlink(ctx context.Context, name string) syscall.Errno

type ReadlinkFS

type ReadlinkFS interface {
	Readlink(name string) (string, error)
}

type RemoteCommandErr

type RemoteCommandErr struct {
	Stderr []byte
	Err    error
}

func (*RemoteCommandErr) Error

func (e *RemoteCommandErr) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL