Documentation
¶
Overview ¶
Package vaultfs provides capability-scoped access to files beneath a vault.
Index ¶
- type LogicalFileError
- type LogicalFileMetadata
- type PrivateTemp
- type Root
- func (r *Root) Close() error
- func (r *Root) Inspect(name string) (LogicalFileMetadata, error)
- func (r *Root) MkdirAll(name string, perm os.FileMode) error
- func (r *Root) Open(name string) (*os.File, error)
- func (r *Root) ReadFile(name string) ([]byte, error)
- func (r *Root) Remove(name string) error
- func (r *Root) Stat(name string) (os.FileInfo, error)
- func (r *Root) WriteFile(name string, data []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogicalFileError ¶ added in v0.7.0
type LogicalFileError struct {
Code string `json:"code"`
}
func (*LogicalFileError) Error ¶ added in v0.7.0
func (e *LogicalFileError) Error() string
type LogicalFileMetadata ¶ added in v0.7.0
type PrivateTemp ¶ added in v0.7.0
type PrivateTemp struct {
// contains filtered or unexported fields
}
PrivateTemp is a generated, root-confined temporary directory. It only creates private regular files and removes the entire generated directory on cleanup.
func NewPrivateTemp ¶ added in v0.7.0
func NewPrivateTemp(base string) (*PrivateTemp, error)
NewPrivateTemp creates a generated 0700 directory below an existing, non-symlinked temporary root.
func (*PrivateTemp) AvailableBytes ¶ added in v0.7.0
func (t *PrivateTemp) AvailableBytes() (uint64, error)
AvailableBytes returns the current free-space estimate for the temp volume.
func (*PrivateTemp) Cleanup ¶ added in v0.7.0
func (t *PrivateTemp) Cleanup() error
Cleanup closes capabilities and removes the generated directory. It is safe to call more than once.
func (*PrivateTemp) Create ¶ added in v0.7.0
func (t *PrivateTemp) Create(name string) (*os.File, error)
Create creates a new 0600 file directly beneath the generated directory.
func (*PrivateTemp) Dir ¶ added in v0.7.0
func (t *PrivateTemp) Dir() string
Dir returns the generated directory path for local cleanup diagnostics only.
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
Root confines filesystem operations to a vault directory. Path containment, including symlink resolution, is enforced by os.Root at the operation.
func (*Root) Inspect ¶ added in v0.7.0
func (r *Root) Inspect(name string) (LogicalFileMetadata, error)