ifile

package
v0.0.0-...-1414ade Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ifile

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

func New

func New(filePath string, mode Mode, appendToExisting bool, log *zap.Logger) (ifile *Ifile, err error)

func (*Ifile) Close

func (i *Ifile) Close() (err error)

func (*Ifile) Walk

func (i *Ifile) Walk(root string) error

type Mode

type Mode int
const (
	// Include file. Paths are absolute.
	ModeRestic Mode = iota
	// Ignore file. Paths are relative to the .gitignore/.csignore.
	ModeSyncthing
)

func (Mode) String

func (m Mode) String() string

type WatchJob

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

func NewWatchJob

func NewWatchJob(ifile, scanPath string, mode Mode, runPreHooks, runPostHooks func() error, log *zap.Logger) *WatchJob

func (*WatchJob) Ifile

func (j *WatchJob) Ifile() string

func (*WatchJob) Info

func (j *WatchJob) Info() *WatchJobInfo

func (*WatchJob) Run

func (j *WatchJob) Run() (err error)

func (*WatchJob) ScanPath

func (j *WatchJob) ScanPath() string

func (*WatchJob) Shutdown

func (j *WatchJob) Shutdown() error

func (*WatchJob) Status

func (j *WatchJob) Status() WatchJobStatus

type WatchJobInfo

type WatchJobInfo struct {
	Ifile  string   `json:"ifile"`
	Errors []string `json:"errors"`
	Mode   string   `json:"mode"`
}

type WatchJobStatus

type WatchJobStatus int32
const (
	WatchJobStatusWillRun WatchJobStatus = iota
	WatchJobStatusRunning
	WatchJobStatusFailed
	WatchJobStatusStopped
)

func (WatchJobStatus) String

func (s WatchJobStatus) String() string

Jump to

Keyboard shortcuts

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