filesaver

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Driver Driver `json:"driver" yaml:"driver" ini:"driver"`

	Local localfile.Config `json:"local" yaml:"local" ini:"local"` // 本地文件系统
	FTP   ftp.Config       `json:"ftp" yaml:"ftp" ini:"ftp"`       // ftp
	SFTP  sftp.Config      `json:"sftp" yaml:"sftp" ini:"sftp"`    // sftp
	HDFS  hdfs.Config      `json:"hdfs" yaml:"hdfs" ini:"hdfs"`    // hdfs
	Minio minio.Config     `json:"minio" yaml:"minio" ini:"minio"` // minio
}

noinspection all

type Driver

type Driver string
const (
	DriverLocal Driver = "local"
	DriverSftp  Driver = "sftp"
	DriverFtp   Driver = "ftp"
	DriverHdfs  Driver = "hdfs"
	DriverMinio Driver = "minio"
	DriverCeph  Driver = "ceph"
)

noinspection all

type FileSaver

type FileSaver interface {
	Write(p string, src io.Reader, existIgnores ...bool) (int64, error) // 写入文件
	Read(p string) (io.ReadCloser, error)                               // 读取文件
	Delete(p string) error                                              // 删除指定文件
	DeleteAll(p string) error                                           // 删除文件夹
	ListFiles(p string) ([]string, error)                               // 列出指定目录下的所有文件
	Close() error                                                       // 关闭资源
}

func New

func New(cfg *Config) (FileSaver, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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