stream

package
v0.0.0-...-873fb03 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirChecker

type DirChecker interface {
	Exists(dir string) bool
	IsDir(dir string) bool
}

type DirCopier

type DirCopier interface {
	Copy(src, dst string) error
}

type DirCreateChecker

type DirCreateChecker interface {
	DirCreater
	DirChecker
}

type DirCreateCheckerCopy

type DirCreateCheckerCopy interface {
	DirCreater
	DirChecker
	DirCopier
}

type DirCreateHasher

type DirCreateHasher interface {
	DirCreater
	DirHasher
}

type DirCreateListCopier

type DirCreateListCopier interface {
	DirCreater
	DirLister
	DirCopier
}

type DirCreateListCopyRemover

type DirCreateListCopyRemover interface {
	DirCreater
	DirLister
	DirCopier
	DirRemover
}

type DirCreater

type DirCreater interface {
	Create(dir string) error
}

type DirHasher

type DirHasher interface {
	Hash(dir string) (string, error)
}

type DirListChecker

type DirListChecker interface {
	DirLister
	DirChecker
}

type DirLister

type DirLister interface {
	List(dir string, hiddenDir bool) ([]string, error)
}

type DirManager

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

func NewDirManager

func NewDirManager(file FileCopier) DirManager

func (DirManager) Copy

func (m DirManager) Copy(src, dest string) error

func (DirManager) Create

func (m DirManager) Create(dir string) error

Create creates a directory named dir A successful call returns err == nil

func (DirManager) Exists

func (m DirManager) Exists(dir string) bool

func (DirManager) Hash

func (m DirManager) Hash(dir string) (string, error)

func (DirManager) IsDir

func (m DirManager) IsDir(dir string) bool

func (DirManager) List

func (m DirManager) List(dir string, hiddenDir bool) ([]string, error)

List list all directories associate with dir name, case hiddenDir is true, we will add hidden directories to your slice of directories. If success, List returns a slice of directories and a nil error. If error, List returns an empty slice and a non-nil error.

func (DirManager) Remove

func (m DirManager) Remove(dir string) error

Remove removes dir and any children it contains.

type DirRemover

type DirRemover interface {
	Remove(dir string) error
}

type FileAppender

type FileAppender interface {
	Append(path string, content []byte) error
}

type FileCopier

type FileCopier interface {
	Copy(src, dst string) error
}

type FileCopyExistListerWriter

type FileCopyExistListerWriter interface {
	FileLister
	FileCopier
	FileExister
	FileWriter
}

type FileCreator

type FileCreator interface {
	Create(path string, data io.ReadCloser) error
}

type FileExister

type FileExister interface {
	Exists(path string) bool
}

type FileLister

type FileLister interface {
	List(file string) ([]string, error)
}

type FileManager

type FileManager struct {
}

FileManager implements FileWriteReadExistRemover

func NewFileManager

func NewFileManager() FileManager

NewFileManager returns a FileManage that writes from w reads from r, exists from e and removes from re

func (FileManager) Append

func (f FileManager) Append(path string, content []byte) error

func (FileManager) Copy

func (f FileManager) Copy(src, dest string) error

func (FileManager) Create

func (f FileManager) Create(path string, data io.ReadCloser) error

func (FileManager) Exists

func (f FileManager) Exists(path string) bool

Exists returns true if file path exists

func (FileManager) List

func (f FileManager) List(dir string) ([]string, error)

List lists all files in dir path

func (FileManager) ListNews

func (f FileManager) ListNews(oldPath, newPath string) ([]string, error)

func (FileManager) Move

func (f FileManager) Move(oldPath, newPath string, files []string) error

func (FileManager) Read

func (f FileManager) Read(path string) ([]byte, error)

Read reads the file named by path and returns the contents. A successful call returns err == nil

func (FileManager) Remove

func (f FileManager) Remove(path string) error

Remove removes the named file

func (FileManager) Write

func (f FileManager) Write(path string, content []byte) error

Write writes content to a file named by path. A successful call returns err == nil

type FileMover

type FileMover interface {
	Move(oldPath, newPath string, files []string) error
}

type FileNewListMoveRemover

type FileNewListMoveRemover interface {
	FileMover
	FileRemover
	FileNewLister
}

type FileNewLister

type FileNewLister interface {
	ListNews(oldPath, newPath string) ([]string, error)
}

FileNewLister list all new files compared between old and new path

type FileReadExister

type FileReadExister interface {
	FileReader
	FileExister
}

type FileReadWriter

type FileReadWriter interface {
	FileReader
	FileWriter
}

type FileReader

type FileReader interface {
	Read(path string) ([]byte, error)
}

type FileRemover

type FileRemover interface {
	Remove(path string) error
}

type FileWriteCreatorReadExistRemover

type FileWriteCreatorReadExistRemover interface {
	FileWriter
	FileCreator
	FileReader
	FileExister
	FileRemover
}

type FileWriteExistAppender

type FileWriteExistAppender interface {
	FileWriter
	FileExister
	FileAppender
}

type FileWriteReadExistLister

type FileWriteReadExistLister interface {
	FileWriter
	FileReader
	FileExister
	FileLister
}

type FileWriteReadExistRemover

type FileWriteReadExistRemover interface {
	FileWriter
	FileReader
	FileExister
	FileRemover
}

type FileWriteReadExister

type FileWriteReadExister interface {
	FileWriter
	FileReader
	FileExister
}

type FileWriteRemover

type FileWriteRemover interface {
	FileWriter
	FileRemover
}

type FileWriter

type FileWriter interface {
	Write(path string, content []byte) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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