SessionFSProvider is the interface that SDK users implement to provide a session filesystem. Methods use idiomatic Go error handling: return an error for failures (the adapter maps os.ErrNotExist → ENOENT automatically). To add SQLite support, also implement [SessionFSSqliteProvider] on the same ty
| 18 | // |
| 19 | // To add SQLite support, also implement [SessionFSSqliteProvider] on the same type. |
| 20 | type SessionFSProvider interface { |
| 21 | // ReadFile reads the full content of a file. Return os.ErrNotExist (or wrap it) |
| 22 | // if the file does not exist. |
| 23 | ReadFile(path string) (string, error) |
| 24 | // WriteFile writes content to a file, creating it and parent directories if needed. |
| 25 | // mode is an optional POSIX-style permission mode. Pass nil to use the OS default. |
| 26 | WriteFile(path string, content string, mode *int) error |
| 27 | // AppendFile appends content to a file, creating it and parent directories if needed. |
| 28 | // mode is an optional POSIX-style permission mode. Pass nil to use the OS default. |
| 29 | AppendFile(path string, content string, mode *int) error |
| 30 | // Exists checks whether the given path exists. |
| 31 | Exists(path string) (bool, error) |
| 32 | // Stat returns metadata about a file or directory. |
| 33 | // Return os.ErrNotExist if the path does not exist. |
| 34 | Stat(path string) (*SessionFSFileInfo, error) |
| 35 | // Mkdir creates a directory. If recursive is true, create parent directories as needed. |
| 36 | // mode is an optional POSIX-style permission mode (e.g., 0o755). Pass nil to use the OS default. |
| 37 | MakeDirectory(path string, recursive bool, mode *int) error |
| 38 | // Readdir lists the names of entries in a directory. |
| 39 | // Return os.ErrNotExist if the directory does not exist. |
| 40 | ReadDirectory(path string) ([]string, error) |
| 41 | // ReaddirWithTypes lists entries with type information. |
| 42 | // Return os.ErrNotExist if the directory does not exist. |
| 43 | ReadDirectoryWithTypes(path string) ([]rpc.SessionFSReaddirWithTypesEntry, error) |
| 44 | // Rm removes a file or directory. If recursive is true, remove contents too. |
| 45 | // If force is true, do not return an error when the path does not exist. |
| 46 | Remove(path string, recursive bool, force bool) error |
| 47 | // Rename moves/renames a file or directory. |
| 48 | Rename(src string, dest string) error |
| 49 | } |
| 50 | |
| 51 | // SessionFSSqliteProvider is an optional interface that a [SessionFSProvider] |
| 52 | // may also implement to support per-session SQLite databases. The adapter |
no outgoing calls
no test coverage detected
searching dependent graphs…