local

package
v0.0.0-...-63b751e Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalStorage

type LocalStorage struct{}

LocalStorage is a struct that implements the Storage interface.

func (*LocalStorage) GetBackupPath

func (ls *LocalStorage) GetBackupPath(path string) (string, error)

GetBackupPath returns the path where the backup will be stored. This implementation is part of the LocalStorage struct, which manages local backup paths. The function determines the local backup directory path and ensures that the directory exists, creating it if necessary.

Returns the determined backup path or an error if path determination or directory creation fails.

func (*LocalStorage) WriteBackup

func (ls *LocalStorage) WriteBackup(data []byte, resource string) error

WriteBackup writes the backup data to a specified path. This implementation is part of the LocalStorage struct, which contains the logic for managing backups on the local file system. If the provided path is a directory, the function will copy the contents of the backup data (as multiple files) into that directory. If the path is a file, it creates the file and writes the backup data to it.

Returns an error if the path is invalid, if the directory cannot be accessed, or if file operations fail.

Jump to

Keyboard shortcuts

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