Documentation
¶
Index ¶
- Constants
- Variables
- func Dirname(name string) string
- func ErrNotExist(err error) error
- func ID(value string) string
- func IsNotExist(err error) bool
- func ValidPath(name string) error
- type FileItem
- type Item
- func (z *Item) DecodeMsg(dc *msgp.Reader) (err error)
- func (i Item) Dir() string
- func (z *Item) EncodeMsg(en *msgp.Writer) (err error)
- func (i Item) IsDir() bool
- func (i Item) IsZero() bool
- func (z *Item) MarshalMsg(b []byte) (o []byte, err error)
- func (i Item) ModTime() time.Time
- func (i Item) Mode() os.FileMode
- func (z *Item) Msgsize() (s int)
- func (i Item) Name() string
- func (i Item) Size() int64
- func (i Item) String() string
- func (i Item) Sys() any
- func (z *Item) UnmarshalMsg(bts []byte) (o []byte, err error)
- type ReadAtSeekCloser
- type Storage
- type WriteOpts
Constants ¶
View Source
const DirectoryPerm = 0o700
Variables ¶
View Source
var ( ErrRelativePath = errors.New("name contains relatives paths") ErrInvalidPath = errors.New("name is invalid") )
Functions ¶
func ErrNotExist ¶
func IsNotExist ¶
Types ¶
type FileItem ¶ added in v1.6.0
type Item ¶
type Item struct {
Date time.Time `msg:"date" json:"date"`
ID string `msg:"id" json:"id"`
NameValue string `msg:"name" json:"name"`
Pathname string `msg:"pathname" json:"pathname"`
Extension string `msg:"extension" json:"extension"`
SizeValue int64 `msg:"size" json:"size"`
FileMode uint32 `msg:"fileMode" json:"fileMode"`
IsDirValue bool `msg:"isDir" json:"isDir"`
}
func (*Item) MarshalMsg ¶ added in v1.6.0
MarshalMsg implements msgp.Marshaler
type ReadAtSeekCloser ¶ added in v1.4.4
type ReadAtSeekCloser interface {
io.ReadSeekCloser
io.ReaderAt
}
type Storage ¶
type Storage interface {
Stat(ctx context.Context, name string) (Item, error)
Mkdir(ctx context.Context, name string, perm os.FileMode) error
OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (*FileItem, error)
Rename(ctx context.Context, oldName, newName string) error
RemoveAll(ctx context.Context, name string) error
Enabled() bool
Name() string
WithIgnoreFn(ignoreFn func(Item) bool) Storage
Path(name string) string
List(ctx context.Context, name string) ([]Item, error)
WriteTo(ctx context.Context, name string, reader io.Reader, opts WriteOpts) error
ReadFrom(ctx context.Context, name string) (ReadAtSeekCloser, error)
Walk(ctx context.Context, name string, walkFn func(Item) error) error
UpdateDate(ctx context.Context, name string, date time.Time) error
ConvertError(err error) error
}
Click to show internal directories.
Click to hide internal directories.