utils

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat = "2006-01-02T15:04:05.000Z"
)

Variables

This section is empty.

Functions

func GenerateRandomHexString added in v0.1.18

func GenerateRandomHexString(length int) (string, error)

GenerateRandomHexString generates a random hex string of the desired length.

func GetNeverSynced added in v0.1.3

func GetNeverSynced() time.Time

Returns a time used to signify that a file has never been synced.

func HasBeenSynced added in v0.1.3

func HasBeenSynced(lastCloudUpdate time.Time) bool

Returns true if the file has been synced based on the last cloud update.

func InSlice

func InSlice(item string, slice []string) bool

InSlice returns true if item is present in slice.

func PathExists

func PathExists(path string) (bool, error)

func RealPath

func RealPath(path string) (string, error)

Types

type AESGCMEncryptor added in v0.1.10

type AESGCMEncryptor struct {
	Key []byte
}

func (*AESGCMEncryptor) DecryptReader added in v0.1.10

func (e *AESGCMEncryptor) DecryptReader(reader io.ReadCloser) (io.ReadCloser, error)

func (*AESGCMEncryptor) EncryptReader added in v0.1.10

func (e *AESGCMEncryptor) EncryptReader(reader io.Reader) (io.Reader, error)

type Logger added in v0.1.12

type Logger interface {
	Debugf(template string, args ...interface{})
	Infof(template string, args ...interface{})
	Warnf(template string, args ...interface{})
	Errorf(template string, args ...interface{})
	Panicf(template string, args ...interface{})
}

type NopEncryptor added in v0.1.15

type NopEncryptor struct{}

func (*NopEncryptor) DecryptReader added in v0.1.15

func (e *NopEncryptor) DecryptReader(reader io.ReadCloser) (io.ReadCloser, error)

func (*NopEncryptor) EncryptReader added in v0.1.15

func (e *NopEncryptor) EncryptReader(reader io.Reader) (io.Reader, error)

type ReaderEncryptor added in v0.1.10

type ReaderEncryptor interface {
	EncryptReader(reader io.Reader) (io.Reader, error)
	DecryptReader(reader io.ReadCloser) (io.ReadCloser, error)
}

Jump to

Keyboard shortcuts

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