memory

package
v0.0.0-...-14e102d Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opt *Option) (driver.FS, error)

仅供测试使用

Types

type Memory

type Memory struct {
	driver.Base
	// contains filtered or unexported fields
}

func (*Memory) Copy

func (d *Memory) Copy(ctx context.Context, src, dst string) error

func (*Memory) Create

func (d *Memory) Create(path string) (driver.FileWriter, error)

func (*Memory) Get

func (d *Memory) Get(ctx context.Context, path string) (driver.File, error)

func (*Memory) List

func (d *Memory) List(ctx context.Context, path string, metas ...driver.Meta) ([]driver.File, error)

func (*Memory) MakeDir

func (d *Memory) MakeDir(ctx context.Context, path string) error

func (*Memory) Move

func (d *Memory) Move(ctx context.Context, src, dst string) error

func (*Memory) Open

func (d *Memory) Open(path string) (driver.FileReader, error)

func (*Memory) Remove

func (d *Memory) Remove(ctx context.Context, path string) error

func (*Memory) Rename

func (d *Memory) Rename(ctx context.Context, path, newName string) error

type Option

type Option struct {
	base.Option
	Files fstest.MapFS
}

func (*Option) NewFS

func (opt *Option) NewFS() (driver.FS, error)

Jump to

Keyboard shortcuts

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