Documentation ¶
Index ¶
Constants ¶
View Source
const ( /* File int the specified folder are exported to the federation by default */ TrackByDefault = iota /* Folder is checked for changes in quasi-realtime way. Typically used for data streaming */ QuasiRealTime )
View Source
const ( New UpdateState = "new" Newer = "newer" Older = "older" Conflict = "conflict" Deleted = "deleted" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct { Loc string Type ActionType }
type ActionType ¶
type ActionType string
const ( ApplyUpdate ActionType = "update" IgnoreUpdate = "ignore" )
type Connection ¶
type Connection interface { Close() /* NetStat provides statistic information about the available exchanges */ NetStat() []NetStat /* AutoSync enables/disables the automatic Push and Pull from the Federation. The parameter is the delay between each sync. When 0 the sync is suspended */ AutoSync(period time.Duration) /* Push changes to the federation */ Push() int /* Pull changes from the federation */ Pull() int /* GetState returns the current differences between the federation and the local files */ GetState() State /* Merge applies the specified actions. It returns false if the state has changed in the meantime and the client is expected to call GetState again */ Merge(stateId int64, actions []Action) bool /* Mount adds a folder to be replicated to the federation */ Mount(folder string, options ...MountOption) error /* Define whether the file should be exported or not to the federation in case of changes */ SetTracked(file string, tracked bool) error IsTracked(file string) bool /* GetAttr gets the attribute with secret for the file */ GetAttr(file string, key string) ([]byte, error) /* SetAttr sets the attribute with secret for the file */ SetAttr(file string, key string, value []byte) error /* Sync saves all changes to disk */ Sync() error /* Retrieve an operational log */ GetLog(name LogName, since time.Time) (Log, error) GetErrorLog(since time.Time) ErrorLog Watch(func(Event)) /* Creates an invite for the federation node */ Invite(key string, exchanges []string, removeSecrets bool) (string, error) }
type MountOption ¶
type MountOption int
type Option ¶
type Option func(config *config_)
func WithSecret ¶
func WithStoreMaxSize ¶
func WithStoreSpan ¶
type Update ¶
type Update struct { State UpdateState `json:"state"` ModTime time.Time `json:"modTime"` Delete bool `json:"delete"` // contains filtered or unexported fields }
type UpdateState ¶
type UpdateState string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.