bilib

package
v1.61.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 13 Imported by: 1

Documentation

Overview

Package bilib provides common stuff for bisync and bisync_test

Package bilib provides common stuff for bisync and bisync_test Here it's got local file/directory helpers (nice to have in lib/file)

Package bilib provides common stuff for bisync and bisync_test

Index

Constants

View Source
const PermSecure = 0600

PermSecure is a Unix permission for a file accessible only by its owner

Variables

This section is empty.

Functions

func CanonicalPath

func CanonicalPath(remote string) string

CanonicalPath converts a remote to a suitable base file name

func CaptureOutput

func CaptureOutput(fun func()) []byte

CaptureOutput runs a function capturing its output.

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir copies a local directory

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies a local file

func CopyFileIfExists

func CopyFileIfExists(srcFile, dstFile string) error

CopyFileIfExists is like CopyFile but does to fail if source does not exist

func FileExists

func FileExists(file string) bool

FileExists returns true if the local file exists

func FsPath

func FsPath(f fs.Fs) string

FsPath converts Fs to a suitable rclone argument

func IsLocalPath

func IsLocalPath(path string) bool

IsLocalPath returns true if its argument is a non-remote path. Empty string or a relative path will be considered local. Note: `c:dir` will be considered local on Windows but remote on Linux.

func SaveList

func SaveList(list []string, path string) error

SaveList saves file name list in a text file

func SessionName

func SessionName(fs1, fs2 fs.Fs) string

SessionName makes a unique base name for the sync operation

Types

type Names

type Names map[string]interface{}

Names comprises a set of file names

func ToNames

func ToNames(list []string) Names

ToNames converts string slice to a set of names

func (Names) Add

func (ns Names) Add(name string)

Add adds new file name to the set

func (Names) Has

func (ns Names) Has(name string) bool

Has checks whether given name is present in the set

func (Names) NotEmpty

func (ns Names) NotEmpty() bool

NotEmpty checks whether set is not empty

func (Names) Save

func (ns Names) Save(path string) error

Save saves name set in a text file

func (Names) ToList

func (ns Names) ToList() []string

ToList converts name set to string slice

Jump to

Keyboard shortcuts

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