adapter

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Abstract

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

*

  • 通用基类 *
  • @create 2021-8-1
  • @author deatil

func (*Abstract) ApplyPathPrefix

func (at *Abstract) ApplyPathPrefix(path string) string

添加前缀

func (*Abstract) GetPathPrefix

func (at *Abstract) GetPathPrefix() string

获取前缀

func (*Abstract) RemovePathPrefix

func (at *Abstract) RemovePathPrefix(path string) string

移除前缀

func (*Abstract) SetPathPrefix

func (at *Abstract) SetPathPrefix(prefix string)

设置前缀

type Adapter

type Adapter struct {
	Abstract
}

*

  • 空适配器 *
  • @create 2021-8-1
  • @author deatil

func (*Adapter) Copy

func (ap *Adapter) Copy(path string, newpath string) error

复制

func (*Adapter) CreateDir

func (ap *Adapter) CreateDir(dirname string, conf interfaces.Config) (map[string]string, error)

创建文件夹

func (*Adapter) Delete

func (ap *Adapter) Delete(path string) error

删除

func (*Adapter) DeleteDir

func (ap *Adapter) DeleteDir(dirname string) error

删除文件夹

func (*Adapter) EnsureDirectory

func (ap *Adapter) EnsureDirectory(root string) error

确认文件夹

func (*Adapter) GetMetadata

func (ap *Adapter) GetMetadata(path string) (map[string]interface{}, error)

func (*Adapter) GetMimetype

func (ap *Adapter) GetMimetype(path string) (map[string]interface{}, error)

func (*Adapter) GetSize

func (ap *Adapter) GetSize(path string) (map[string]interface{}, error)

func (*Adapter) GetTimestamp

func (ap *Adapter) GetTimestamp(path string) (map[string]interface{}, error)

func (*Adapter) GetVisibility

func (ap *Adapter) GetVisibility(path string) (map[string]string, error)

获取文件的权限

func (*Adapter) Has

func (ap *Adapter) Has(string) bool

判断

func (*Adapter) Init

func (ap *Adapter) Init(config ...map[string]interface{})

初始化

func (*Adapter) ListContents

func (ap *Adapter) ListContents(directory string, recursive ...bool) ([]map[string]interface{}, error)

列出内容

func (*Adapter) Read

func (ap *Adapter) Read(path string) (map[string]interface{}, error)

func (*Adapter) ReadStream

func (ap *Adapter) ReadStream(path string) (map[string]interface{}, error)

func (*Adapter) Rename

func (ap *Adapter) Rename(path string, newpath string) error

重命名

func (*Adapter) SetVisibility

func (ap *Adapter) SetVisibility(path string, visibility string) (map[string]string, error)

设置文件的权限

func (*Adapter) Update

func (ap *Adapter) Update(path string, contents string, conf interfaces.Config) (map[string]interface{}, error)

更新

func (*Adapter) UpdateStream

func (ap *Adapter) UpdateStream(path string, stream *os.File, conf interfaces.Config) (map[string]interface{}, error)

更新

func (*Adapter) Write

func (ap *Adapter) Write(path string, contents string, conf interfaces.Config) (map[string]interface{}, error)

上传

func (*Adapter) WriteStream

func (ap *Adapter) WriteStream(path string, stream *os.File, conf interfaces.Config) (map[string]interface{}, error)

上传 Stream 文件类型

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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