MCPcopy
hub / github.com/pocketbase/pocketbase / NewBackupsFilesystem

Method NewBackupsFilesystem

core/base.go:736–750  ·  view source on GitHub ↗

NewBackupsFilesystem creates a new local or S3 filesystem instance for managing app backups based on the current app settings. NB! Make sure to call Close() on the returned result after you are done working with it.

()

Source from the content-addressed store, hash-verified

734// NB! Make sure to call Close() on the returned result
735// after you are done working with it.
736func (app *BaseApp) NewBackupsFilesystem() (*filesystem.System, error) {
737 if app.settings != nil && app.settings.Backups.S3.Enabled {
738 return filesystem.NewS3(
739 app.settings.Backups.S3.Bucket,
740 app.settings.Backups.S3.Region,
741 app.settings.Backups.S3.Endpoint,
742 app.settings.Backups.S3.AccessKey,
743 app.settings.Backups.S3.Secret,
744 app.settings.Backups.S3.ForcePathStyle,
745 )
746 }
747
748 // fallback to local filesystem
749 return filesystem.NewLocal(filepath.Join(app.DataDir(), LocalBackupsDirName))
750}
751
752// Restart restarts (aka. replaces) the current running application process.
753//

Callers 2

Calls 3

DataDirMethod · 0.95
NewS3Function · 0.92
NewLocalFunction · 0.92

Tested by 1