Documentation
¶
Overview ¶
Package filesystem keeps files for the app. It's plain Go on top of the folders the system gives each app, so it needs no plugin add. Paths are relative to the folder, and can't leave it.
filesystem.Write(ctx, filesystem.Data, "orders/1042.json", b) b, err := filesystem.Read(ctx, filesystem.Data, "orders/1042.json") names, err := filesystem.List(ctx, filesystem.Data, "orders")
Under `nimbus native dev` the app runs on this machine, so the files live in the user cache directory instead of on the device.
Index ¶
- Variables
- func Append(ctx context.Context, f Folder, name string, data []byte) error
- func Delete(ctx context.Context, f Folder, name string) error
- func Exists(ctx context.Context, f Folder, name string) (bool, error)
- func List(ctx context.Context, f Folder, name string) ([]string, error)
- func Path(ctx context.Context, f Folder, name string) (string, error)
- func Read(ctx context.Context, f Folder, name string) ([]byte, error)
- func Write(ctx context.Context, f Folder, name string, data []byte) error
- type Folder
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOutside = errors.New("filesystem: path leaves its folder")
ErrOutside is a path that leaves its folder.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.