MCPcopy
hub / github.com/kubernetes/kops / Path

Interface Path

util/pkg/vfs/vfs.go:45–78  ·  view source on GitHub ↗

Path is a path in the VFS space, which we can read, write, list etc

Source from the content-addressed store, hash-verified

43
44// Path is a path in the VFS space, which we can read, write, list etc
45type 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.
81type TerraformPath interface {

Callers 73

RunMethod · 0.95
buildBucketInfoMethod · 0.65
GetBucketMethod · 0.65
CreateBucketMethod · 0.65
buildObjectInfoMethod · 0.65
pathForKeyMethod · 0.65
PutObjectMethod · 0.65
attributeValueAsStringFunction · 0.65
ReadTraceFileFunction · 0.65
readConfigMethod · 0.65
writeConfigMethod · 0.65
ListMethod · 0.65

Implementers 9

AssetPathupup/models/vfs.go
MemFSPathutil/pkg/vfs/memfs.go
SwiftPathutil/pkg/vfs/swiftfs.go
KubernetesPathutil/pkg/vfs/k8sfs.go
S3Pathutil/pkg/vfs/s3fs.go
AzureBlobPathutil/pkg/vfs/azureblob.go
SSHPathutil/pkg/vfs/sshfs.go
GSPathutil/pkg/vfs/gsfs.go
FSPathutil/pkg/vfs/fs.go

Calls

no outgoing calls

Tested by

no test coverage detected