Documentation ¶
Index ¶
- Variables
- func AWSErrorCode(err error) string
- func CopyTree(src Path, dest Path, aclOracle ACLOracle) error
- func IsClusterReadable(p Path) bool
- func IsDirectory(p Path) bool
- func NewSwiftClient() (*gophercloud.ServiceClient, error)
- func RelativePath(base Path, child Path) (string, error)
- func RetryWithBackoff(backoff wait.Backoff, condition func() (bool, error)) (bool, error)
- func SyncDir(src *VFSScan, destBase Path) error
- type ACL
- type ACLOracle
- type Change
- type ChangeType
- type FSPath
- func (p *FSPath) Base() string
- func (p *FSPath) CreateFile(data []byte, acl ACL) error
- func (p *FSPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error)
- func (p *FSPath) Join(relativePath ...string) Path
- func (p *FSPath) Path() string
- func (p *FSPath) PreferredHash() (*hashing.Hash, error)
- func (p *FSPath) ReadDir() ([]Path, error)
- func (p *FSPath) ReadFile() ([]byte, error)
- func (p *FSPath) ReadTree() ([]Path, error)
- func (p *FSPath) Remove() error
- func (p *FSPath) String() string
- func (p *FSPath) WriteFile(data []byte, acl ACL) error
- type GSAcl
- type GSPath
- func (p *GSPath) Base() string
- func (p *GSPath) Bucket() string
- func (p *GSPath) Client() *storage.Service
- func (p *GSPath) CreateFile(data []byte, acl ACL) error
- func (p *GSPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error)
- func (p *GSPath) Join(relativePath ...string) Path
- func (p *GSPath) Object() string
- func (p *GSPath) Path() string
- func (p *GSPath) PreferredHash() (*hashing.Hash, error)
- func (p *GSPath) ReadDir() ([]Path, error)
- func (p *GSPath) ReadFile() ([]byte, error)
- func (p *GSPath) ReadTree() ([]Path, error)
- func (p *GSPath) Remove() error
- func (p *GSPath) String() string
- func (p *GSPath) WriteFile(data []byte, acl ACL) error
- type HasClusterReadable
- type HasHash
- type KubernetesContext
- type KubernetesPath
- func (p *KubernetesPath) Base() string
- func (p *KubernetesPath) CreateFile(data []byte, acl ACL) error
- func (p *KubernetesPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error)
- func (p *KubernetesPath) Host() string
- func (p *KubernetesPath) Join(relativePath ...string) Path
- func (p *KubernetesPath) Key() string
- func (p *KubernetesPath) Path() string
- func (p *KubernetesPath) PreferredHash() (*hashing.Hash, error)
- func (p *KubernetesPath) ReadDir() ([]Path, error)
- func (p *KubernetesPath) ReadFile() ([]byte, error)
- func (p *KubernetesPath) ReadTree() ([]Path, error)
- func (p *KubernetesPath) Remove() error
- func (p *KubernetesPath) String() string
- func (p *KubernetesPath) WriteFile(data []byte, acl ACL) error
- type MemFSContext
- type MemFSPath
- func (p *MemFSPath) Base() string
- func (p *MemFSPath) CreateFile(data []byte, acl ACL) error
- func (c *MemFSPath) IsClusterReadable() bool
- func (p *MemFSPath) Join(relativePath ...string) Path
- func (p *MemFSPath) Path() string
- func (p *MemFSPath) ReadDir() ([]Path, error)
- func (p *MemFSPath) ReadFile() ([]byte, error)
- func (p *MemFSPath) ReadTree() ([]Path, error)
- func (p *MemFSPath) Remove() error
- func (p *MemFSPath) String() string
- func (p *MemFSPath) WriteFile(data []byte, acl ACL) error
- type OpenstackConfig
- type Path
- type S3Context
- type S3Path
- func (p *S3Path) Base() string
- func (p *S3Path) Bucket() string
- func (p *S3Path) CreateFile(data []byte, acl ACL) error
- func (p *S3Path) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error)
- func (p *S3Path) Join(relativePath ...string) Path
- func (p *S3Path) Key() string
- func (p *S3Path) Path() string
- func (p *S3Path) PreferredHash() (*hashing.Hash, error)
- func (p *S3Path) ReadDir() ([]Path, error)
- func (p *S3Path) ReadFile() ([]byte, error)
- func (p *S3Path) ReadTree() ([]Path, error)
- func (p *S3Path) Remove() error
- func (p *S3Path) String() string
- func (p *S3Path) WriteFile(data []byte, aclObj ACL) error
- type SSHPath
- func (p *SSHPath) Base() string
- func (p *SSHPath) CreateFile(data []byte, acl ACL) error
- func (p *SSHPath) Join(relativePath ...string) Path
- func (p *SSHPath) Path() string
- func (p *SSHPath) ReadDir() ([]Path, error)
- func (p *SSHPath) ReadFile() ([]byte, error)
- func (p *SSHPath) ReadTree() ([]Path, error)
- func (p *SSHPath) Remove() error
- func (p *SSHPath) String() string
- func (p *SSHPath) WriteFile(data []byte, acl ACL) error
- type SwiftPath
- func (p *SwiftPath) Base() string
- func (p *SwiftPath) Bucket() string
- func (p *SwiftPath) CreateFile(data []byte, acl ACL) error
- func (p *SwiftPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error)
- func (p *SwiftPath) Join(relativePath ...string) Path
- func (p *SwiftPath) Path() string
- func (p *SwiftPath) PreferredHash() (*hashing.Hash, error)
- func (p *SwiftPath) ReadDir() ([]Path, error)
- func (p *SwiftPath) ReadFile() ([]byte, error)
- func (p *SwiftPath) ReadTree() ([]Path, error)
- func (p *SwiftPath) Remove() error
- func (p *SwiftPath) String() string
- func (p *SwiftPath) WriteFile(data []byte, acl ACL) error
- type VFS
- type VFSContext
- type VFSScan
- type WriteOption
Constants ¶
This section is empty.
Variables ¶
var Context = VFSContext{ // contains filtered or unexported fields }
Functions ¶
func AWSErrorCode ¶
AWSErrorCode returns the aws error code, if it is an awserr.Error, otherwise ""
func CopyTree ¶
CopyTree copies all files in src to dest. It copies the whole recursive subtree of files.
func IsClusterReadable ¶
func IsDirectory ¶
func NewSwiftClient ¶
func NewSwiftClient() (*gophercloud.ServiceClient, error)
func RetryWithBackoff ¶
RetryWithBackoff runs until a condition function returns true, or until Steps attempts have been taken As compared to wait.ExponentialBackoff, this function returns the results from the function on the final attempt
Types ¶
type ChangeType ¶
type ChangeType string
const ChangeType_Added ChangeType = "ADDED"
const ChangeType_Modified ChangeType = "MODIFIED"
const ChangeType_Removed ChangeType = "REMOVED"
type GSAcl ¶
type GSAcl struct {
Acl []*storage.ObjectAccessControl
}
GSAcl is an ACL implementation for objects on Google Cloud Storage
type GSPath ¶
type GSPath struct {
// contains filtered or unexported fields
}
GSPath is a vfs path for Google Cloud Storage
type HasClusterReadable ¶
type HasClusterReadable interface {
IsClusterReadable() bool
}
type KubernetesContext ¶
type KubernetesContext struct { }
KubernetesContext is the context for a Kubernetes VFS implementation
func NewKubernetesContext ¶
func NewKubernetesContext() *KubernetesContext
NewKubernetesContext builds a KubernetesContext This will likely take a kubernetes rest client object (or similar) once the implementation is more complete
type KubernetesPath ¶
type KubernetesPath struct {
// contains filtered or unexported fields
}
KubernetesPath is a path for a VFS backed by the kubernetes API Currently all operations are no-ops
func (*KubernetesPath) Base ¶
func (p *KubernetesPath) Base() string
func (*KubernetesPath) CreateFile ¶
func (p *KubernetesPath) CreateFile(data []byte, acl ACL) error
func (*KubernetesPath) Hash ¶
func (p *KubernetesPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error)
func (*KubernetesPath) Host ¶
func (p *KubernetesPath) Host() string
func (*KubernetesPath) Join ¶
func (p *KubernetesPath) Join(relativePath ...string) Path
func (*KubernetesPath) Key ¶
func (p *KubernetesPath) Key() string
func (*KubernetesPath) Path ¶
func (p *KubernetesPath) Path() string
func (*KubernetesPath) PreferredHash ¶
func (p *KubernetesPath) PreferredHash() (*hashing.Hash, error)
func (*KubernetesPath) ReadDir ¶
func (p *KubernetesPath) ReadDir() ([]Path, error)
func (*KubernetesPath) ReadFile ¶
func (p *KubernetesPath) ReadFile() ([]byte, error)
func (*KubernetesPath) ReadTree ¶
func (p *KubernetesPath) ReadTree() ([]Path, error)
func (*KubernetesPath) Remove ¶
func (p *KubernetesPath) Remove() error
func (*KubernetesPath) String ¶
func (p *KubernetesPath) String() string
type MemFSContext ¶
type MemFSContext struct {
// contains filtered or unexported fields
}
func NewMemFSContext ¶
func NewMemFSContext() *MemFSContext
func (*MemFSContext) MarkClusterReadable ¶
func (c *MemFSContext) MarkClusterReadable()
MarkClusterReadable pretends the current memfscontext is cluster readable; this is useful for tests
type MemFSPath ¶
type MemFSPath struct {
// contains filtered or unexported fields
}
func NewMemFSPath ¶
func NewMemFSPath(context *MemFSContext, location string) *MemFSPath
func (*MemFSPath) IsClusterReadable ¶
type OpenstackConfig ¶
type OpenstackConfig struct { }
func (OpenstackConfig) GetCredential ¶
func (oc OpenstackConfig) GetCredential() (gophercloud.AuthOptions, error)
func (OpenstackConfig) GetServiceConfig ¶
func (oc OpenstackConfig) GetServiceConfig(name string) (gophercloud.EndpointOpts, error)
type Path ¶
type Path interface { Join(relativePath ...string) Path ReadFile() ([]byte, error) WriteFile(data []byte, acl ACL) error // CreateFile writes the file contents, but only if the file does not already exist CreateFile(data []byte, acl ACL) error // Remove deletes the file Remove() error // Base returns the base name (last element) Base() string // Path returns a string representing the full path Path() string // ReadDir lists the files in a particular Path ReadDir() ([]Path, error) // ReadTree lists all files (recursively) in the subtree rooted at the current Path ReadTree() ([]Path, error) }
Path is a path in the VFS space, which we can read, write, list etc
type S3Context ¶
type S3Context struct {
// contains filtered or unexported fields
}
func NewS3Context ¶
func NewS3Context() *S3Context
type SwiftPath ¶
type SwiftPath struct {
// contains filtered or unexported fields
}
SwiftPath is a vfs path for Openstack Cloud Storage.
func NewSwiftPath ¶
func NewSwiftPath(client *gophercloud.ServiceClient, bucket string, key string) (*SwiftPath, error)
type VFSContext ¶
type VFSContext struct {
// contains filtered or unexported fields
}
VFSContext is a 'context' for VFS, that is normally a singleton but allows us to configure S3 credentials, for example
func (*VFSContext) BuildVfsPath ¶
func (c *VFSContext) BuildVfsPath(p string) (Path, error)
func (*VFSContext) ReadFile ¶
func (c *VFSContext) ReadFile(location string) ([]byte, error)
ReadLocation reads a file from a vfs URL It supports additional schemes which don't (yet) have full VFS implementations:
metadata: reads from instance metadata on GCE/AWS http / https: reads from HTTP
func (*VFSContext) ResetMemfsContext ¶
func (c *VFSContext) ResetMemfsContext(clusterReadable bool)
type VFSScan ¶
type VFSScan struct { Base Path // contains filtered or unexported fields }
VFSScan scans a source Path for changes files
func NewVFSScan ¶
type WriteOption ¶
type WriteOption string
const ( WriteOptionCreate WriteOption = "Create" WriteOptionOnlyIfExists WriteOption = "IfExists" )