Documentation ¶
Overview ¶
Package endpoints provides implementations of various synchronization endpoints Currently supported are FS, S3 and in-memory DB
Index ¶
- Variables
- func CanonicalPath(path string) string
- func PipeChan(capacity int) (inputCh chan notify.EventInfo, outputCh chan notify.EventInfo)
- type DBEvent
- type Discarder
- type FSClient
- func (c *FSClient) ComputeChecksum(node *tree.Node) error
- func (c *FSClient) CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error)
- func (c *FSClient) DeleteNode(ctx context.Context, path string) (err error)
- func (c *FSClient) GetEndpointInfo() common.EndpointInfo
- func (c *FSClient) GetReaderOn(path string) (out io.ReadCloser, err error)
- func (c *FSClient) GetWriterOn(path string, targetSize int64) (out io.WriteCloser, err error)
- func (c *FSClient) LoadNode(ctx context.Context, path string, leaf ...bool) (node *tree.Node, err error)
- func (c *FSClient) MoveNode(ctx context.Context, oldPath string, newPath string) (err error)
- func (c *FSClient) UpdateNode(ctx context.Context, node *tree.Node) (err error)
- func (c *FSClient) Walk(walknFc common.WalkNodesFunc, pathes ...string) (err error)
- func (c *FSClient) Watch(recursivePath string) (*common.WatchObject, error)
- type MemDB
- func (db *MemDB) ComputeChecksum(node *tree.Node) error
- func (db *MemDB) CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error)
- func (db *MemDB) DeleteNode(ctx context.Context, path string) (err error)
- func (db *MemDB) FindByHash(hash string) (node *tree.Node)
- func (db *MemDB) FindByUuid(id string) (node *tree.Node)
- func (c *MemDB) GetEndpointInfo() common.EndpointInfo
- func (db *MemDB) LoadNode(ctx context.Context, path string, leaf ...bool) (node *tree.Node, err error)
- func (db *MemDB) MoveNode(ctx context.Context, oldPath string, newPath string) (err error)
- func (db *MemDB) RegisterEventChannel(out chan DBEvent)
- func (db *MemDB) Stats() string
- func (db *MemDB) String() string
- func (db *MemDB) UpdateNode(ctx context.Context, node *tree.Node) (err error)
- func (db *MemDB) Walk(walknFc common.WalkNodesFunc, pathes ...string) (err error)
- func (db *MemDB) Watch(recursivePath string) (*common.WatchObject, error)
- type MockableMinio
- type S3Client
- func (c *S3Client) ComputeChecksum(node *tree.Node) error
- func (c *S3Client) CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error)
- func (c *S3Client) DeleteNode(ctx context.Context, path string) (err error)
- func (c *S3Client) GetEndpointInfo() common.EndpointInfo
- func (c *S3Client) GetReaderOn(path string) (out io.ReadCloser, err error)
- func (c *S3Client) GetWriterOn(path string, targetSize int64) (out io.WriteCloser, err error)
- func (c *S3Client) LoadNode(ctx context.Context, path string, leaf ...bool) (node *tree.Node, err error)
- func (c *S3Client) MoveNode(ctx context.Context, oldPath string, newPath string) (err error)
- func (c *S3Client) SetPlainSizeComputer(computer func(nodeUUID string) (int64, error))
- func (c *S3Client) Stat(path string) (i os.FileInfo, err error)
- func (c *S3Client) UpdateNode(ctx context.Context, node *tree.Node) (err error)
- func (c *S3Client) UpdateNodeUuid(ctx context.Context, node *tree.Node) (*tree.Node, error)
- func (c *S3Client) Walk(walknFc common.WalkNodesFunc, pathes ...string) (err error)
- func (c *S3Client) Watch(recursivePath string) (*common.WatchObject, error)
- type S3ClientFSWatch
- type S3FileInfo
Constants ¶
This section is empty.
Variables ¶
var ( UserAgentAppName = "pydio.sync.client.s3" UserAgentVersion = "1.0" )
var ( // EventTypePut contains the notify events that will cause a put (writer) EventTypeAll = []notify.Event{notify.All} // EventTypePut contains the notify events that will cause a put (writer) EventTypePut = []notify.Event{notify.Create, notify.Write, notify.Rename} // EventTypePut contains the notify events that will cause a put (writer) EventTypeCreate = []notify.Event{notify.Create} // EventTypePut contains the notify events that will cause a put (writer) EventTypeWrite = []notify.Event{notify.Write} // EventTypePut contains the notify events that will cause a put (writer) EventTypeRename = []notify.Event{notify.Rename} // EventTypeDelete contains the notify events that will cause a delete (remove) EventTypeDelete = []notify.Event{notify.Remove} // EventTypeGet contains the notify events that will cause a get (read) EventTypeGet = []notify.Event{} // On macOS, FreeBSD, Solaris this is not available. )
Functions ¶
func CanonicalPath ¶
TODO MOVE IN A fs_windows FILE TO AVOID RUNTIME OS CHECK
Types ¶
type FSClient ¶
FSClient implementation of an endpoint Implements all Sync interfaces (PathSyncTarget, PathSyncSource, DataSyncTarget and DataSyncSource) Takes a root folder as main parameter Underlying calls to FS are done through Afero.FS virtualization, allowing for mockups and automated testings.
func NewFSClient ¶
func (*FSClient) ComputeChecksum ¶ added in v1.5.0
func (*FSClient) CreateNode ¶
func (*FSClient) DeleteNode ¶
func (*FSClient) GetEndpointInfo ¶
func (c *FSClient) GetEndpointInfo() common.EndpointInfo
func (*FSClient) GetReaderOn ¶
func (c *FSClient) GetReaderOn(path string) (out io.ReadCloser, err error)
func (*FSClient) GetWriterOn ¶
func (*FSClient) LoadNode ¶
func (c *FSClient) LoadNode(ctx context.Context, path string, leaf ...bool) (node *tree.Node, err error)
LoadNode is the Read in CRUD. leaf bools are used to avoid doing an FS.stat if we already know a node to be a leaf. NOTE : is it useful? Examine later.
func (*FSClient) UpdateNode ¶
type MemDB ¶
func (*MemDB) ComputeChecksum ¶ added in v1.5.0
func (*MemDB) CreateNode ¶
func (*MemDB) DeleteNode ¶
func (*MemDB) GetEndpointInfo ¶
func (c *MemDB) GetEndpointInfo() common.EndpointInfo
func (*MemDB) LoadNode ¶
func (db *MemDB) LoadNode(ctx context.Context, path string, leaf ...bool) (node *tree.Node, err error)
***********************
Path Sync Target
***********************
func (*MemDB) UpdateNode ¶
type MockableMinio ¶
type MockableMinio interface { StatObject(bucket string, path string, opts minio.StatObjectOptions) (minio.ObjectInfo, error) RemoveObject(bucket string, path string) error PutObject(bucket string, path string, reader io.Reader, size int64, opts minio.PutObjectOptions) (n int64, err error) GetObject(bucket string, path string, opts minio.GetObjectOptions) (object *minio.Object, err error) ListObjectsV2(bucketName, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan minio.ObjectInfo CopyObject(dest minio.DestinationInfo, source minio.SourceInfo) error ListenBucketNotification(bucketName, prefix, suffix string, events []string, doneCh <-chan struct{}) <-chan minio.NotificationInfo }
type S3Client ¶
type S3Client struct { Mc MockableMinio Bucket string RootPath string ServerRequiresNormalization bool // contains filtered or unexported fields }
TODO For Minio, add an initialization for detecting empty folders and creating PYDIO_SYNC_HIDDEN_FILE_META
func NewS3Client ¶
func (*S3Client) ComputeChecksum ¶ added in v1.5.0
func (*S3Client) CreateNode ¶
func (*S3Client) DeleteNode ¶
func (*S3Client) GetEndpointInfo ¶
func (c *S3Client) GetEndpointInfo() common.EndpointInfo
func (*S3Client) GetReaderOn ¶
func (c *S3Client) GetReaderOn(path string) (out io.ReadCloser, err error)
func (*S3Client) GetWriterOn ¶
func (*S3Client) SetPlainSizeComputer ¶ added in v1.6.0
func (*S3Client) UpdateNode ¶
func (*S3Client) UpdateNodeUuid ¶ added in v1.0.0
UpdateNodeUuid makes this endpoint an UuidReceiver
type S3ClientFSWatch ¶
func NewS3ClientFSWatch ¶
func (*S3ClientFSWatch) Watch ¶
func (c *S3ClientFSWatch) Watch(recursivePath string) (*common.WatchObject, error)
type S3FileInfo ¶
type S3FileInfo struct { Object minio.ObjectInfo // contains filtered or unexported fields }
func NewS3FileInfo ¶
func NewS3FileInfo(object minio.ObjectInfo) *S3FileInfo
func NewS3FolderInfo ¶
func NewS3FolderInfo(object minio.ObjectInfo) *S3FileInfo
func (*S3FileInfo) Size ¶
func (s *S3FileInfo) Size() int64
length in bytes for regular files; system-dependent for others
func (*S3FileInfo) Sys ¶
func (s *S3FileInfo) Sys() interface{}
underlying data source (can return nil)