Documentation
¶
Overview ¶
Package local provides a local synchronization endpoint implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEndpoint ¶
func NewEndpoint( logger *logging.Logger, root string, sessionIdentifier string, version synchronization.Version, configuration *synchronization.Configuration, alpha bool, options ...EndpointOption, ) (synchronization.Endpoint, error)
NewEndpoint creates a new local endpoint instance using the specified session metadata and options.
Types ¶
type EndpointOption ¶
type EndpointOption interface {
// contains filtered or unexported methods
}
EndpointOption is the interface for specifying endpoint options. It cannot be constructed or implemented directly, only by one of option constructors provided by this package.
func WithCachePathCallback ¶
func WithCachePathCallback(callback func(string, bool) (string, error)) EndpointOption
WithCachePathCallback overrides the function that the endpoint uses to compute cache storage paths. The specified callback will be provided with two arguments: the session identifier (a UUID) and a boolean indicating whether or not this is the alpha endpoint (if false, it's the beta endpoint). The function should return a path that is consistent but unique in terms of these two arguments.
func WithStagingRootCallback ¶
WithStagingRootCallback overrides the function that the endpoint uses to compute staging root paths. The specified callback will be provided with two arguments: the session identifier (a UUID) and a boolean indicating whether or not this is the alpha endpoint (if false, it's the beta endpoint). The function should return a path that is consistent but unique in terms of these two arguments, as well as whether or not the generated staging root should be marked as hidden when re-created. The path may exist, but if it does must be a directory, and it will be regularly deleted/re-created.