daemon

package
v0.0.0-...-593c148 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(configLocation string)

Start backer daemon Registers an S3 uploader and a fileManager to watch the watchers

Types

type BackerEvent

type BackerEvent struct {
	Type Event
	Path string
}

BackerEvent - Event structure which contains a filepath and an event type

type Backlog

type Backlog interface {
	Add(path BackerEvent)
	Next() BackerEvent
	RemoveOne() (empty bool)
}

Backlog - struct for maintaining a list of events to process

type Event

type Event int

Event - Event type from FSNotify

const (
	// CREATE - File is created
	CREATE Event = 1 + iota
	// REMOVE - File is removed
	REMOVE
	// WRITE - File is modified
	WRITE
)

type FileManager

type FileManager struct {
	// contains filtered or unexported fields
}

FileManager - Manages the interaction between FSNotify events and the various data backends

func NewFileManager

func NewFileManager(config *shared.BackerConfig) *FileManager

NewFileManager - Helper function for creating a new FileManager

func (*FileManager) RegisterWatcherPath

func (f *FileManager) RegisterWatcherPath(path string, remoteRoot string)

RegisterWatcherPath - Register a file path with the Manager, will subscribe to FSEvents for this path

func (*FileManager) Start

func (f *FileManager) Start(eventChannel <-chan fsnotify.Event, errorChannel <-chan error)

Start - Start watching for File events

type MultiFileBacklog

type MultiFileBacklog struct {
	// contains filtered or unexported fields
}

MultiFileBacklog - data structure for maintaining Backlog state

func NewMultiFileBacklog

func NewMultiFileBacklog() *MultiFileBacklog

NewMultiFileBacklog - Creates a new Backlog

func (*MultiFileBacklog) Add

func (b *MultiFileBacklog) Add(event BackerEvent)

Add - Add a file event to the backlog

func (*MultiFileBacklog) Next

func (b *MultiFileBacklog) Next() BackerEvent

Next - retrieves the next BackerEvent from the Backlog

func (*MultiFileBacklog) RemoveOne

func (b *MultiFileBacklog) RemoveOne() bool

RemoveOne - Removes a single BackerEvent from the Backlog

type RPC

type RPC struct {
	Config *shared.BackerConfig
}

RPC - RPC interface

func (*RPC) ListWatchers

func (r *RPC) ListWatchers(args int, watchers *shared.FileWatchers) error

ListWatchers - Implementation from the interface definition

func (*RPC) SayHello

func (r *RPC) SayHello(args int, reply *string) error

SayHello - Dummy Function (to remove)

Jump to

Keyboard shortcuts

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