file

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

* @Descripttion: beyondstorage实现的文件管理 * @version: * @Author: lfzxs@qq.com * @Date: 2022-09-27 15:20:31

  • @LastEditors: lfzxs@qq.com
  • @LastEditTime: 2022-12-06 16:04:52

* @DOC: https://beyondstorage.dev/zh-CN/docs/go-storage/operations/storager/index

  • @Descripttion:

  • @version:

  • @Author: lfzxs@qq.com

  • @Date: 2022-10-12 14:11:41

  • @LastEditors: lfzxs@qq.com

  • @LastEditTime: 2022-12-06 16:03:27

  • @Descripttion:

  • @version:

  • @Author: lfzxs@qq.com

  • @Date: 2022-11-12 09:56:37

  • @LastEditors: lfzxs@qq.com

  • @LastEditTime: 2022-11-12 11:17:25

Index

Constants

View Source
const (
	// 默认配置为同目录下的files目录
	DefaultInstanceName = "default"
)

Variables

View Source
var (
	FileSysMrg = fileSysMrg{}
)

Functions

func CreateStorager

func CreateStorager(connStr string) (result *beyondstorageFile, err error)

Types

type ILogicFile

type ILogicFile interface {
	// 写入文件
	WriteFile(path string, r io.Reader, size int64, pairs ...hctypes.Pair) (writeSize int64, err error)

	// 追加文件
	AppendFile(path string, r io.Reader, size int64, pairs ...hctypes.Pair) (writeSize int64, err error)

	// 读取文件
	ReadFile(path string) (data []byte, err error)

	// 随机读取
	ReadRange(path string, start int64, size int64) (data []byte, err error)

	// 删除文件
	RemoveFile(path string) (err error)

	// 重命名文件
	RenameFile(path string, name string) (err error)

	// 文件列表
	ListFile(path string) (oi *btypes.ObjectIterator, err error)

	// 判断文件是否存在
	Exists(path string) (yes bool)

	// 获取文件信息
	FileInfo(path string) (pairs []hctypes.Pair, err error)

	// 复制文件
	CopyFile(source string, dest string) (err error)

	// 移动文件
	MoveFile(source string, targetDir string) (err error)

	// 创建目录
	CreateDir(path string, dirName string) (dirpath string, err error)

	// 移动目录
	MoveDir(source string, dest string) (err error)

	// 删除目录
	RemoveDir(path string) (err error)

	// 目录信息
	DirInfo(path string) (pairs []hctypes.Pair, err error)
	// 重命名文件
	RenameDir(path string, name string) (err error)

	// 获取连接串
	GetConnstr() string
}

逻辑文件操作

func DefaultLogicFile

func DefaultLogicFile() ILogicFile

func Instance

func Instance(name ...string) ILogicFile

Jump to

Keyboard shortcuts

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