file

package
v0.0.0-...-b681e62 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package file provides file management modules

Index

Constants

View Source
const DefaultBackupLocation = "/var/lib/bossbox/file_backups"

Variables

View Source
var ErrBackingUpFile = errors.New("failed to backup old file")
View Source
var ErrSwappingFiles = errors.New("failed to swap tmp and dst files")

Functions

func LocalSource

func LocalSource(path string) func() (io.ReadCloser, error)

Types

type File

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

func NewFile

func NewFile(path string, contents func() (io.ReadCloser, error)) File

func (*File) Apply

func (f *File) Apply(ctx context.Context) (bool, error)

func (*File) Check

func (f *File) Check(ctx context.Context) (bool, error)

func (*File) EnableBackups

func (f *File) EnableBackups() error

func (*File) Name

func (f *File) Name() string

func (*File) SetBackupLocation

func (f *File) SetBackupLocation(location string) error

Jump to

Keyboard shortcuts

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