Documentation
¶
Overview ¶
Package io some io operation functions
Index ¶
- func Copy(src, dst string, opts ...CopyOption) error
- func GetIOStreams(ctx context.Context) (ioStreams *clioptions.IOStreams)
- func IsDir(dir string) bool
- func IsExist(path string) bool
- func IsFile(file string) bool
- func MustGetIOStreams(ctx context.Context) (ioStreams *clioptions.IOStreams)
- func WithIOStreams(ctx context.Context, ioStreams *clioptions.IOStreams) context.Context
- func WriteFile(dstFile string, content []byte, perm os.FileMode) error
- type Config
- type CopyOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
func Copy(src, dst string, opts ...CopyOption) error
Copy support copy file to file or dir to dir
func GetIOStreams ¶
func GetIOStreams(ctx context.Context) (ioStreams *clioptions.IOStreams)
GetIOStreams returns IOStreams stored in the context if any if not found will return nil *IOStreams
func MustGetIOStreams ¶
func MustGetIOStreams(ctx context.Context) (ioStreams *clioptions.IOStreams)
MustGetIOStreams gets the IOStream from context or initiates a default using os.Stdin, os.Stout, os.Sterr
func WithIOStreams ¶
WithIOStreams adds IOStreams into the context
Types ¶
type CopyOption ¶
type CopyOption func(config *Config)
CopyOption function for setting CopyConfig
func FileFilterOption ¶
func FileFilterOption(f func(srcFile, dstFile string) bool) CopyOption
FileFilterOption construct file filter `CopyOption`
Click to show internal directories.
Click to hide internal directories.