local

package
v0.7.0-beta1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package local provides the default, in-memory, filesystem-based endpoint implementation for local endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HousekeepCaches

func HousekeepCaches()

HousekeepCaches performs housekeeping of caches.

func HousekeepStaging

func HousekeepStaging()

HousekeepStaging performs housekeeping of staging roots.

func NewEndpoint

func NewEndpoint(
	root,
	session string,
	version session.Version,
	configuration *session.Configuration,
	alpha bool,
	options ...EndpointOption,
) (session.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

func WithStagingRootCallback(callback func(string, bool) (string, error)) EndpointOption

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. The path may exist, but if it does must be a directory.

func WithWatchingMechanism

func WithWatchingMechanism(callback func(context.Context, string, chan<- struct{})) EndpointOption

WithWatchingMechanism overrides the filesystem watching function that the endpoint uses to monitor for filesystem changes. The specified function will be provided with three arguments: a context to indicate watch cancellation, the path to be watched (recursively), and an events channel that should be populated in a non-blocking fashion every time an event occurs. If an error occurs during watching, the event channel should be closed. It should also be closed on cancellation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL