Documentation
¶
Index ¶
- Variables
- func AddTrustedCert(url string) error
- func ClearAuthToken()
- type Credentials
- type SdfsConnection
- func (n *SdfsConnection) Chmod(ctx context.Context, path string, mode int32) (err error)
- func (n *SdfsConnection) Chown(ctx context.Context, path string, gid int32, uid int32) (err error)
- func (n *SdfsConnection) CleanStore(ctx context.Context, compact, waitForCompletion bool) (event *spb.SDFSEvent, err error)
- func (n *SdfsConnection) CloseConnection(ctx context.Context) error
- func (n *SdfsConnection) CopyExtent(ctx context.Context, src, dst string, srcStart, dstStart, len int64) (written int64, err error)
- func (n *SdfsConnection) CopyFile(ctx context.Context, src, dst string, returnImmediately bool) (event *spb.SDFSEvent, err error)
- func (n *SdfsConnection) DSEInfo(ctx context.Context) (info *spb.DSEInfo, err error)
- func (n *SdfsConnection) DeleteCloudVolume(ctx context.Context, volumeid int64, waitForCompletion bool) (event *spb.SDFSEvent, err error)
- func (n *SdfsConnection) DeleteFile(ctx context.Context, path string) error
- func (n *SdfsConnection) Download(ctx context.Context, src, dst string) (bytesread int64, err error)
- func (n *SdfsConnection) FileExists(ctx context.Context, path string) (exists bool, err error)
- func (n *SdfsConnection) FileNotification(ctx context.Context, fileInfo chan *spb.FileMessageResponse) error
- func (n *SdfsConnection) Flush(ctx context.Context, path string, fh int64) (err error)
- func (n *SdfsConnection) Fsync(ctx context.Context, path string, fh int64) error
- func (n *SdfsConnection) GetAttr(ctx context.Context, path string) (stat *spb.Stat, err error)
- func (n *SdfsConnection) GetCloudFile(ctx context.Context, path, dst string, overwrite, waitForCompletion bool) (event *spb.SDFSEvent, err error)
- func (n *SdfsConnection) GetCloudMetaFile(ctx context.Context, path, dst string, overwrite, waitForCompletion bool) (event *spb.SDFSEvent, err error)
- func (n *SdfsConnection) GetConnectedVolumes(ctx context.Context) (info []*spb.ConnectedVolumeInfo, err error)
- func (n *SdfsConnection) GetEvent(ctx context.Context, eventid string) (*spb.SDFSEvent, error)
- func (n *SdfsConnection) GetGCSchedule(ctx context.Context) (schedule string, err error)
- func (n *SdfsConnection) GetVolumeInfo(ctx context.Context) (volumeInfo *spb.VolumeInfoResponse, err error)
- func (n *SdfsConnection) GetXAttr(ctx context.Context, key, path string) (value string, err error)
- func (n *SdfsConnection) GetXAttrSize(ctx context.Context, path, key string) (int32, error)
- func (n *SdfsConnection) ListDir(ctx context.Context, path, marker string, compact bool, returnsz int32) (string, []*spb.FileInfoResponse, error)
- func (n *SdfsConnection) ListEvents(ctx context.Context) ([]*spb.SDFSEvent, error)
- func (n *SdfsConnection) MkDir(ctx context.Context, path string, mode int32) error
- func (n *SdfsConnection) MkDirAll(ctx context.Context, path string) error
- func (n *SdfsConnection) MkNod(ctx context.Context, path string, mode, rdev int32) (err error)
- func (n *SdfsConnection) Open(ctx context.Context, path string, flags int32) (fh int64, err error)
- func (n *SdfsConnection) Read(ctx context.Context, fh int64, offset int64, length int32) (data []byte, err error)
- func (n *SdfsConnection) ReadLink(ctx context.Context, path string) (linkpath string, err error)
- func (n *SdfsConnection) Release(ctx context.Context, fh int64) (err error)
- func (n *SdfsConnection) RemoveXAttr(ctx context.Context, key, path string) error
- func (n *SdfsConnection) Rename(ctx context.Context, src, dst string) (err error)
- func (n *SdfsConnection) RmDir(ctx context.Context, path string) error
- func (n *SdfsConnection) SetCacheSize(ctx context.Context, size int64, waitForCompletion bool) (event *spb.SDFSEvent, err error)
- func (n *SdfsConnection) SetPassword(ctx context.Context, password string) (err error)
- func (n *SdfsConnection) SetReadSpeed(ctx context.Context, speed int32) (err error)
- func (n *SdfsConnection) SetUserMetaData(ctx context.Context, path string, fileAttributes []*spb.FileAttributes) (err error)
- func (n *SdfsConnection) SetVolumeCapacity(ctx context.Context, size int64) (err error)
- func (n *SdfsConnection) SetWriteSpeed(ctx context.Context, speed int32) (err error)
- func (n *SdfsConnection) SetXAttr(ctx context.Context, key, value, path string) error
- func (n *SdfsConnection) ShutdownVolume(ctx context.Context) (err error)
- func (n *SdfsConnection) Stat(ctx context.Context, path string) (*spb.FileInfoResponse, error)
- func (n *SdfsConnection) StatFS(ctx context.Context) (stat *spb.StatFS, err error)
- func (n *SdfsConnection) SymLink(ctx context.Context, src, dst string) (err error)
- func (n *SdfsConnection) SyncCloudVolume(ctx context.Context, waitForCompletion bool) (event *spb.SDFSEvent, err error)
- func (n *SdfsConnection) SyncFromCloudVolume(ctx context.Context, volumeid int64, waitForCompletion bool) (event *spb.SDFSEvent, err error)
- func (n *SdfsConnection) SystemInfo(ctx context.Context) (info *spb.SystemInfo, err error)
- func (n *SdfsConnection) Truncate(ctx context.Context, path string, length int64) (err error)
- func (n *SdfsConnection) Unlink(ctx context.Context, path string) (err error)
- func (n *SdfsConnection) Upload(ctx context.Context, src, dst string) (written int64, err error)
- func (n *SdfsConnection) Utime(ctx context.Context, path string, atime, mtime int64) (err error)
- func (n *SdfsConnection) WaitForEvent(ctx context.Context, eventid string) (*spb.SDFSEvent, error)
- func (n *SdfsConnection) Write(ctx context.Context, fh int64, data []byte, offset int64, length int32) (err error)
- type SdfsError
Constants ¶
This section is empty.
Variables ¶
var DisableTrust bool
DisableTrust is a hardcoded DisableTrust
var Password string
Password is a hardcoded Password
var UserName string
UserName is a hardcoded UserName
Functions ¶
func AddTrustedCert ¶ added in v0.1.36
AddTrustedCert adds a trusted Cert
func ClearAuthToken ¶ added in v0.1.36
func ClearAuthToken()
Clear AuthToken will remove the current auth token to authenticate to the client
Types ¶
type Credentials ¶
type Credentials struct { ServerURL string `yaml:"url" required:"true" envconfig:"SDFS_URL" default:"sdfss://localhost:6442"` Password string `yaml:"password" default:"" envconfig:"SDFS_PASSWORD" default:""` DisableTrust bool `yaml:"disable_trust" envconfig:"SDFS_DISABLE_TRUST"` // contains filtered or unexported fields }
A Credentials Struct
type SdfsConnection ¶
type SdfsConnection struct {
// contains filtered or unexported fields
}
SdfsConnection is the connection info
func NewConnection ¶
func NewConnection(path string) (*SdfsConnection, error)
NewConnection Created a new connectio given a path
func (*SdfsConnection) Chmod ¶
Chmod sets permission of the requested file to the requested permissions
func (*SdfsConnection) CleanStore ¶
func (n *SdfsConnection) CleanStore(ctx context.Context, compact, waitForCompletion bool) (event *spb.SDFSEvent, err error)
CleanStore does garbage collection on the volume
func (*SdfsConnection) CloseConnection ¶
func (n *SdfsConnection) CloseConnection(ctx context.Context) error
CloseConnection closes the grpc connection to the volume
func (*SdfsConnection) CopyExtent ¶ added in v0.1.14
func (n *SdfsConnection) CopyExtent(ctx context.Context, src, dst string, srcStart, dstStart, len int64) (written int64, err error)
CopyExtent creates a snapshop of a give source to a given destination
func (*SdfsConnection) CopyFile ¶
func (n *SdfsConnection) CopyFile(ctx context.Context, src, dst string, returnImmediately bool) (event *spb.SDFSEvent, err error)
CopyFile creates a snapshop of a give source to a given destination
func (*SdfsConnection) DeleteCloudVolume ¶
func (n *SdfsConnection) DeleteCloudVolume(ctx context.Context, volumeid int64, waitForCompletion bool) (event *spb.SDFSEvent, err error)
DeleteCloudVolume deletes a volume that is no longer in use
func (*SdfsConnection) DeleteFile ¶
func (n *SdfsConnection) DeleteFile(ctx context.Context, path string) error
DeleteFile removes a given file
func (*SdfsConnection) Download ¶ added in v0.1.30
func (n *SdfsConnection) Download(ctx context.Context, src, dst string) (bytesread int64, err error)
Download downloads a file from SDFS locally
func (*SdfsConnection) FileExists ¶
FileExists checks if a file Exists given a path.
func (*SdfsConnection) FileNotification ¶ added in v0.1.31
func (n *SdfsConnection) FileNotification(ctx context.Context, fileInfo chan *spb.FileMessageResponse) error
FileNotification notifies over a channel for all events when a file is downloaded for Sync
func (*SdfsConnection) GetCloudFile ¶
func (n *SdfsConnection) GetCloudFile(ctx context.Context, path, dst string, overwrite, waitForCompletion bool) (event *spb.SDFSEvent, err error)
GetCloudFile hydrates a given file from object storage to the local filesystem.
func (*SdfsConnection) GetCloudMetaFile ¶
func (n *SdfsConnection) GetCloudMetaFile(ctx context.Context, path, dst string, overwrite, waitForCompletion bool) (event *spb.SDFSEvent, err error)
GetCloudMetaFile downloads the metadata for given file from object storage but does not hydrate it into the local hashtable.
func (*SdfsConnection) GetConnectedVolumes ¶
func (n *SdfsConnection) GetConnectedVolumes(ctx context.Context) (info []*spb.ConnectedVolumeInfo, err error)
GetConnectedVolumes returns all the volumes sharing the same storage
func (*SdfsConnection) GetGCSchedule ¶
func (n *SdfsConnection) GetGCSchedule(ctx context.Context) (schedule string, err error)
GetGCSchedule returns the current Garbage collection schedule for the volume
func (*SdfsConnection) GetVolumeInfo ¶
func (n *SdfsConnection) GetVolumeInfo(ctx context.Context) (volumeInfo *spb.VolumeInfoResponse, err error)
GetVolumeInfo returns the volume info
func (*SdfsConnection) GetXAttrSize ¶
GetXAttrSize gets the list size for attributes. This is useful for a fuse implementation
func (*SdfsConnection) ListDir ¶
func (n *SdfsConnection) ListDir(ctx context.Context, path, marker string, compact bool, returnsz int32) (string, []*spb.FileInfoResponse, error)
ListDir lists a directory
func (*SdfsConnection) ListEvents ¶
ListEvents lists all the events that have occured
func (*SdfsConnection) MkDirAll ¶
func (n *SdfsConnection) MkDirAll(ctx context.Context, path string) error
MkDirAll makes a directory and all parent directories
func (*SdfsConnection) Read ¶
func (n *SdfsConnection) Read(ctx context.Context, fh int64, offset int64, length int32) (data []byte, err error)
Read reads data from a given filehandle
func (*SdfsConnection) Release ¶
func (n *SdfsConnection) Release(ctx context.Context, fh int64) (err error)
Release closes a given filehandle
func (*SdfsConnection) RemoveXAttr ¶
func (n *SdfsConnection) RemoveXAttr(ctx context.Context, key, path string) error
RemoveXAttr removes a given key for a file
func (*SdfsConnection) Rename ¶ added in v0.1.18
func (n *SdfsConnection) Rename(ctx context.Context, src, dst string) (err error)
Rename renames a file
func (*SdfsConnection) RmDir ¶
func (n *SdfsConnection) RmDir(ctx context.Context, path string) error
RmDir removes a given directory
func (*SdfsConnection) SetCacheSize ¶
func (n *SdfsConnection) SetCacheSize(ctx context.Context, size int64, waitForCompletion bool) (event *spb.SDFSEvent, err error)
SetCacheSize does garbage collection on the volume
func (*SdfsConnection) SetPassword ¶
func (n *SdfsConnection) SetPassword(ctx context.Context, password string) (err error)
SetPassword sets the password for the volume
func (*SdfsConnection) SetReadSpeed ¶
func (n *SdfsConnection) SetReadSpeed(ctx context.Context, speed int32) (err error)
SetReadSpeed sets the read speed in Kb/s
func (*SdfsConnection) SetUserMetaData ¶
func (n *SdfsConnection) SetUserMetaData(ctx context.Context, path string, fileAttributes []*spb.FileAttributes) (err error)
SetUserMetaData sets an array of key value pairs for a given path
func (*SdfsConnection) SetVolumeCapacity ¶
func (n *SdfsConnection) SetVolumeCapacity(ctx context.Context, size int64) (err error)
SetVolumeCapacity sets the logical size of the volume
func (*SdfsConnection) SetWriteSpeed ¶
func (n *SdfsConnection) SetWriteSpeed(ctx context.Context, speed int32) (err error)
SetWriteSpeed sets the write speed in Kb/s
func (*SdfsConnection) SetXAttr ¶
func (n *SdfsConnection) SetXAttr(ctx context.Context, key, value, path string) error
SetXAttr sets a specific key value pair for a given file
func (*SdfsConnection) ShutdownVolume ¶
func (n *SdfsConnection) ShutdownVolume(ctx context.Context) (err error)
ShutdownVolume unmounts the given volume
func (*SdfsConnection) Stat ¶
func (n *SdfsConnection) Stat(ctx context.Context, path string) (*spb.FileInfoResponse, error)
Stat gets a specific file info
func (*SdfsConnection) SymLink ¶
func (n *SdfsConnection) SymLink(ctx context.Context, src, dst string) (err error)
SymLink creates a symlink for a given source and destination
func (*SdfsConnection) SyncCloudVolume ¶
func (n *SdfsConnection) SyncCloudVolume(ctx context.Context, waitForCompletion bool) (event *spb.SDFSEvent, err error)
SyncCloudVolume syncs the current volume from all instances in the cloud
func (*SdfsConnection) SyncFromCloudVolume ¶
func (n *SdfsConnection) SyncFromCloudVolume(ctx context.Context, volumeid int64, waitForCompletion bool) (event *spb.SDFSEvent, err error)
SyncFromCloudVolume syncs the current volume from a give volume id
func (*SdfsConnection) SystemInfo ¶
func (n *SdfsConnection) SystemInfo(ctx context.Context) (info *spb.SystemInfo, err error)
SystemInfo returns system info
func (*SdfsConnection) Unlink ¶
func (n *SdfsConnection) Unlink(ctx context.Context, path string) (err error)
Unlink deletes the given file
func (*SdfsConnection) WaitForEvent ¶
WaitForEvent waits for events to finish and then returns the end event.