Path is a path in the VFS space, which we can read, write, list etc
| 43 | |
| 44 | // Path is a path in the VFS space, which we can read, write, list etc |
| 45 | type Path interface { |
| 46 | io.WriterTo |
| 47 | Join(relativePath ...string) Path |
| 48 | |
| 49 | // ReadFile returns the contents of the file, or an error if the file could not be read. |
| 50 | // If the file did not exist, err = os.ErrNotExist |
| 51 | // As this reads the entire file into memory, consider using WriteTo for bigger files |
| 52 | ReadFile(ctx context.Context) ([]byte, error) |
| 53 | WriteFile(ctx context.Context, data io.ReadSeeker, acl ACL) error |
| 54 | // CreateFile writes the file contents, but only if the file does not already exist |
| 55 | CreateFile(ctx context.Context, data io.ReadSeeker, acl ACL) error |
| 56 | |
| 57 | // Remove deletes the file |
| 58 | Remove(ctx context.Context) error |
| 59 | |
| 60 | // RemoveAll deletes all files recursively, deletes only files as returned per ReadTree |
| 61 | RemoveAll(ctx context.Context) error |
| 62 | |
| 63 | // RemoveAllVersions completely deletes the file (with all its versions and markers). |
| 64 | RemoveAllVersions(ctx context.Context) error |
| 65 | |
| 66 | // Base returns the base name (last element) |
| 67 | Base() string |
| 68 | |
| 69 | // Path returns a string representing the full path |
| 70 | Path() string |
| 71 | |
| 72 | // ReadDir lists the files in a particular Path |
| 73 | ReadDir() ([]Path, error) |
| 74 | |
| 75 | // ReadTree lists all files (recursively) in the subtree rooted at the current Path |
| 76 | /// Note: returns only files, not directories |
| 77 | ReadTree(ctx context.Context) ([]Path, error) |
| 78 | } |
| 79 | |
| 80 | // TerraformPath is a Path that can render to Terraform. |
| 81 | type TerraformPath interface { |
no outgoing calls
no test coverage detected