local

package
v1.0.1010 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

type Local struct {
	// 默认适配器基类
	adapter.Adapter
	// contains filtered or unexported fields
}

*

  • 本地文件适配器 / Local adapter *
  • @create 2021-8-1
  • @author deatil

func New

func New(root string) *Local

本地文件适配器

func (*Local) Copy

func (this *Local) Copy(path string, newpath string) error

复制

func (*Local) CreateDir

func (this *Local) CreateDir(dirname string, config interfaces.Config) (map[string]string, error)

创建文件夹

func (*Local) Delete

func (this *Local) Delete(path string) error

删除

func (*Local) DeleteDir

func (this *Local) DeleteDir(dirname string) error

删除文件夹

func (*Local) EnsureDirectory

func (this *Local) EnsureDirectory(root string) error

确认文件夹

func (*Local) GetMetadata

func (this *Local) GetMetadata(path string) (map[string]any, error)

func (*Local) GetMimetype

func (this *Local) GetMimetype(path string) (map[string]any, error)

func (*Local) GetSize

func (this *Local) GetSize(path string) (map[string]any, error)

func (*Local) GetTimestamp

func (this *Local) GetTimestamp(path string) (map[string]any, error)

func (*Local) GetVisibility

func (this *Local) GetVisibility(path string) (map[string]string, error)

设置文件的权限

func (*Local) Has

func (this *Local) Has(path string) bool

判断是否存在

func (*Local) ListContents

func (this *Local) ListContents(directory string, recursive ...bool) ([]map[string]any, error)

列出内容

func (*Local) Read

func (this *Local) Read(path string) (map[string]any, error)

读取

func (*Local) ReadStream

func (this *Local) ReadStream(path string) (map[string]any, error)

读取成文件流 打开文件需要手动关闭

func (*Local) Rename

func (this *Local) Rename(path string, newpath string) error

重命名

func (*Local) SetVisibility

func (this *Local) SetVisibility(path string, visibility string) (map[string]string, error)

设置文件的权限

func (*Local) Update

func (this *Local) Update(path string, contents []byte, conf interfaces.Config) (map[string]any, error)

更新

func (*Local) UpdateStream

func (this *Local) UpdateStream(path string, stream io.Reader, config interfaces.Config) (map[string]any, error)

更新

func (*Local) Write

func (this *Local) Write(path string, contents []byte, conf interfaces.Config) (map[string]any, error)

上传

func (*Local) WriteStream

func (this *Local) WriteStream(path string, stream io.Reader, conf interfaces.Config) (map[string]any, error)

上传 Stream 文件类型

Jump to

Keyboard shortcuts

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