Documentation ¶
Overview ¶
Package common defines vars and constants for the sync package
Index ¶
- func DirWithInternalSeparator(filePath string) string
- func IsIgnoredFile(path string) (ignored bool)
- func PerformTests(basePath string, externalPath string, testInfo chan string, ...)
- type DataSyncSource
- type DataSyncTarget
- type Endpoint
- type EndpointInfo
- type EventInfo
- type EventType
- type PathSyncSource
- type PathSyncTarget
- type ProcessorEvent
- type SessionProvider
- type Versioner
- type WalkNodesFunc
- type WatchObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsIgnoredFile ¶
Types ¶
type DataSyncSource ¶
type DataSyncSource interface { PathSyncSource GetReaderOn(path string) (out io.ReadCloser, err error) }
func AsDataSyncSource ¶
func AsDataSyncSource(endpoint Endpoint) (DataSyncSource, bool)
type DataSyncTarget ¶
type DataSyncTarget interface { PathSyncTarget GetWriterOn(path string, targetSize int64) (out io.WriteCloser, err error) }
func AsDataSyncTarget ¶
func AsDataSyncTarget(endpoint Endpoint) (DataSyncTarget, bool)
type EndpointInfo ¶
type EventInfo ¶
type EventInfo struct { Time string Size int64 Etag string Folder bool Path string PathSyncSource PathSyncSource Type EventType Host string Port string UserAgent string OperationId string ScanEvent bool ScanSourceNode *tree.Node Metadata map[string]string }
EventInfo contains the information of the event that occurred and the source IP:PORT of the client which triggerred the event.
func NodeToEventInfo ¶
type EventType ¶
type EventType string
EventType represents the type of the event occurred.
const ( // EventCreate notifies when a new object is created EventCreate EventType = "ObjectCreated" // EventCreate notifies when a new object is created EventRename EventType = "ObjectRenamed" // EventRemove notifies when a new object is deleted EventRemove EventType = "ObjectRemoved" // EventAccessed notifies when an object is accessed. EventAccessed EventType = "ObjectAccessed" // EventAccessedRead notifies when an object is accessed (specifically read). EventAccessedRead EventType = "ObjectAccessed:Read" // EventAccessedStat notifies when an object is accessed (specifically stat). EventAccessedStat EventType = "ObjectAccessed:Stat" // EventOther notifies any other events EventOther EventType = "ObjectOther" // Use unique path separator everywhere InternalPathSeparator = "/" )
type PathSyncSource ¶
type PathSyncSource interface { Endpoint Walk(walknFc WalkNodesFunc, pathes ...string) (err error) Watch(recursivePath string) (*WatchObject, error) }
func AsPathSyncSource ¶
func AsPathSyncSource(endpoint Endpoint) (PathSyncSource, bool)
type PathSyncTarget ¶
type PathSyncTarget interface { Endpoint CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error) UpdateNode(ctx context.Context, node *tree.Node) (err error) DeleteNode(ctx context.Context, path string) (err error) MoveNode(ctx context.Context, oldPath string, newPath string) (err error) }
func AsPathSyncTarget ¶
func AsPathSyncTarget(endpoint Endpoint) (PathSyncTarget, bool)
type ProcessorEvent ¶
type ProcessorEvent struct { Type string Data interface{} }
type SessionProvider ¶
type SessionProvider interface { StartSession(ctx context.Context, rootNode *tree.Node) (*tree.IndexationSession, error) FinishSession(ctx context.Context, sessionUuid string) error }
func AsSessionProvider ¶
func AsSessionProvider(endpoint Endpoint) (SessionProvider, bool)
type Versioner ¶
type Versioner interface { Commit(node *tree.Node) ListVersions(node *tree.Node) (versions map[int]string, lastVersion int) }
func AsVersioner ¶
type WatchObject ¶
type WatchObject struct { // eventInfo will be put on this chan EventInfoChan chan EventInfo // errors will be put on this chan ErrorChan chan error // will stop the watcher goroutines DoneChan chan bool }
func (*WatchObject) Close ¶
func (w *WatchObject) Close()
Close the watcher, will stop all goroutines
func (WatchObject) Done ¶
func (w WatchObject) Done() <-chan bool
Done returns a channel that unblocks when Close has been called
func (*WatchObject) Errors ¶
func (w *WatchObject) Errors() chan error
Errors returns the chan receiving errors
func (*WatchObject) Events ¶
func (w *WatchObject) Events() chan EventInfo
Events returns the chan receiving events
func (WatchObject) NextError ¶
func (w WatchObject) NextError() error
NextError pops the next error from the ErrorChan
func (WatchObject) NextEvent ¶
func (w WatchObject) NextEvent() EventInfo
NextEvent pops the next event from the EventInfoChan
Click to show internal directories.
Click to hide internal directories.