Documentation ¶
Index ¶
Constants ¶
const ( BlobRead = 'R' // A blob has been read BlobWrite = 'W' // A blob has been written BlobDelete = 'D' // A blob has been deleted )
Define all valid operations.
const DefaultDirMode os.FileMode = 0700
DefaultDirMode is the file mode used for directory creation if not overridden in the Options
const DefaultFileMode os.FileMode = 0600
DefaultFileMode is the file mode used for file creation if not overridden in the Options
Variables ¶
var BlobPathRE = regexp.MustCompile(`^/(data|index|keys|locks|snapshots)/([0-9a-f]{64})?$`)
BlobPathRE matches valid blob URI paths with optional object IDs
var FileTypes = []string{"config"}
FileTypes are files stored directly under the repo direct that are accessible through a request
var ObjectTypes = []string{"data", "index", "keys", "locks", "snapshots"}
ObjectTypes are subdirs that are used for object storage
Functions ¶
This section is empty.
Types ¶
type BlobMetricFunc ¶
type BlobMetricFunc func(objectType string, operation BlobOperation, nBytes uint64)
BlobMetricFunc is the callback signature for blob metrics. Such a callback can be passed in the Options to keep track of various metrics. objectType: one of ObjectTypes operation: one of the BlobOperations above nBytes: the number of bytes affected, or 0 if not relevant TODO: Perhaps add http.Request for the username so that this can be cached?
type BlobOperation ¶
type BlobOperation byte
BlobOperation describe the current blob operation in the BlobMetricFunc callback.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles all REST API requests for a single Restic backup repo Spec: https://restic.readthedocs.io/en/latest/100_references.html#rest-backend
type Options ¶
type Options struct { AppendOnly bool // if set, delete actions are not allowed Debug bool DirMode os.FileMode FileMode os.FileMode NoVerifyUpload bool // If set, we will panic when an internal server error happens. This // makes it easier to debug such errors. PanicOnError bool BlobMetricFunc BlobMetricFunc QuotaManager *quota.Manager }
Options are options for the Handler accepted by New