fsdir

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: MIT Imports: 5 Imported by: 26

Documentation

Overview

Package fsdir provides an abstract interface to a directory on disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

type T string

T is the type of a fsdir.

func New

func New(dir string) (T, error)

New creates a new fsdir.

func (T) Chmod

func (t T) Chmod(mode os.FileMode, ps ...string) error

Chmod changes the permissions of the file or directory under a given path.

func (T) Del

func (t T) Del(ps ...string) error

Del deletes the file or directory under a given path.

func (T) Get

func (t T) Get(x interface{}, ps ...string) error

Get reads the file under the path ps and unmarshals its JSON contents into x.

func (T) Path

func (t T) Path(ps ...string) string

func (T) Set

func (t T) Set(x interface{}, ps ...string) error

Set marshals the x value into JSON and writes it to the the path ps.

Jump to

Keyboard shortcuts

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