Documentation
¶
Overview ¶
Package storage serves a store to agents over gRPC and reaches one: Store holds a store's operations over its index, Server serves them, and Client is the backup.Index an agent uses to talk to a store server. BucketStore keeps a store's archives in a gocloud bucket.
Index ¶
- Variables
- func ArchiveKey(name string) string
- func ClientTLS(caFile string) (*tls.Config, error)
- func NewBucketObjectStore(bucket *blob.Bucket, index pack.ArchiveIndex, cacheDir string, cacheSize int64, ...) (*pack.PackStorage, error)
- func ServerTLS(certFile, keyFile string, plaintextBehindProxy bool) (credentials.TransportCredentials, *tls.Config, error)
- func SignArchiveRange(ctx context.Context, bucket *blob.Bucket, r SignedRange) (*proto.Location, error)
- func ToStatus(err error) error
- type BucketOption
- type BucketStore
- func (c *BucketStore) Checksum(name string) ([]byte, error)
- func (c *BucketStore) Create(name string) (pack.File, error)
- func (c *BucketStore) CreateNew(name string, data []byte) error
- func (c *BucketStore) Delete(name string) error
- func (c *BucketStore) DeleteAll() error
- func (c *BucketStore) List(extension string) ([]string, error)
- func (c *BucketStore) ListInfo(extension string) ([]pack.ListedFile, error)
- func (c *BucketStore) Open(name string) (pack.File, error)
- func (c *BucketStore) OpenListed(file pack.ListedFile) (pack.File, error)
- func (c *BucketStore) SignRange(ctx context.Context, name string, offset, length int64, ttl time.Duration) (*proto.Location, error)
- type Client
- func (r *Client) BeginCommit(ctx context.Context, set string) (*backup.CommitGrant, error)
- func (r *Client) BeginSession(ctx context.Context, s *backup.Session) (context.Context, error)
- func (r *Client) Close() error
- func (r *Client) CommitInfo(ctx context.Context, set string, notAfter time.Time, count int) ([]*proto.Commit, error)
- func (r *Client) CommitSizes(ctx context.Context, set string, notAfter time.Time, count int) ([]*proto.Commit, []*proto.CommitSize, error)
- func (r *Client) CountCommits(ctx context.Context, set string, period proto.Period, from, to time.Time, ...) ([]*proto.CommitCount, error)
- func (r *Client) Delete(context.Context, *proto.Ref) error
- func (r *Client) DeleteCommit(ctx context.Context, ref *proto.Ref) error
- func (r *Client) DeleteSet(ctx context.Context, set string, erase bool) error
- func (r *Client) Downloaded() int64
- func (r *Client) EndSession(ctx context.Context) error
- func (r *Client) EscrowedKeys(ctx context.Context) ([]backup.EscrowedKey, error)
- func (r *Client) FileInfo(ctx context.Context, set string, name string, notAfter time.Time, count int) ([]*proto.TreeNode, error)
- func (r *Client) Get(ctx context.Context, ref *proto.Ref) (*proto.Object, error)
- func (r *Client) GetTree(ctx context.Context, ref *proto.Ref, maxDepth uint32) ([]*proto.Object, error)
- func (r *Client) Has(context.Context, *proto.Ref) (bool, error)
- func (r *Client) LatestCommit(ctx context.Context, set string) (*proto.Ref, error)
- func (r *Client) Open() error
- func (r *Client) Pins(ctx context.Context) ([]*proto.PinInfo, error)
- func (r *Client) Presence(ctx context.Context, set string) (presence.Set, error)
- func (r *Client) Put(ctx context.Context, object *proto.Object) error
- func (r *Client) PutEscrowedKey(ctx context.Context, key backup.EscrowedKey) error
- func (r *Client) PutFile(ctx context.Context, object *proto.Object, assumed []*proto.Ref) ([]*proto.Ref, error)
- func (r *Client) ReIndex(context.Context) (backup.ReIndexReport, error)
- func (r *Client) ReadDir(ctx context.Context, set string, dir string, notAfter time.Time) ([]*proto.TreeNode, error)
- func (r *Client) ReadFiles(ctx context.Context, files []backup.FileRead, objectsOnly bool, ...) error
- func (r *Client) ReadParts(ctx context.Context, file *proto.Ref, skip []int, ...) error
- func (r *Client) TrashedCommits(ctx context.Context, set string, before time.Time, limit int) ([]*proto.TrashedCommit, error)
- func (r *Client) UndeleteCommit(ctx context.Context, ref *proto.Ref) error
- func (r *Client) UndeleteSet(ctx context.Context, set string) error
- func (r *Client) Unpin(ctx context.Context, pin *proto.Ref) error
- func (r *Client) Walk(context.Context, bool, proto.ObjectType, backup.ObjectReceiver) error
- type Operation
- type Receipt
- type Server
- func (r *Server) BeginCommit(ctx context.Context, request *proto.BeginCommitRequest) (*proto.BeginCommitResponse, error)
- func (r *Server) BeginSession(ctx context.Context, request *proto.BeginSessionRequest) (*proto.BeginSessionResponse, error)
- func (r *Server) CommitInfo(ctx context.Context, request *proto.CommitInfoRequest) (*proto.CommitInfoResponse, error)
- func (r *Server) CountCommits(ctx context.Context, request *proto.CountCommitsRequest) (*proto.CountCommitsResponse, error)
- func (r *Server) DeleteCommit(ctx context.Context, request *proto.DeleteCommitRequest) (*proto.DeleteCommitResponse, error)
- func (r *Server) DeleteSet(ctx context.Context, request *proto.DeleteSetRequest) (*proto.DeleteSetResponse, error)
- func (r *Server) EndSession(ctx context.Context, request *proto.EndSessionRequest) (*proto.EndSessionResponse, error)
- func (r *Server) EscrowedKeys(ctx context.Context, _ *proto.EscrowedKeysRequest) (*proto.EscrowedKeysResponse, error)
- func (r *Server) FileInfo(ctx context.Context, request *proto.FileInfoRequest) (*proto.FileInfoResponse, error)
- func (r *Server) Get(ctx context.Context, request *proto.GetRequest) (*proto.GetResponse, error)
- func (r *Server) GetPresence(request *proto.GetPresenceRequest, stream proto.Store_GetPresenceServer) error
- func (r *Server) GetTree(request *proto.GetTreeRequest, stream proto.Store_GetTreeServer) error
- func (r *Server) LatestCommit(ctx context.Context, request *proto.LatestCommitRequest) (*proto.LatestCommitResponse, error)
- func (r *Server) ListPins(ctx context.Context, _ *proto.ListPinsRequest) (*proto.ListPinsResponse, error)
- func (r *Server) ListTrash(ctx context.Context, request *proto.ListTrashRequest) (*proto.ListTrashResponse, error)
- func (r *Server) Put(ctx context.Context, request *proto.PutRequest) (*proto.PutResponse, error)
- func (r *Server) ReadDir(ctx context.Context, request *proto.ReadDirRequest) (*proto.ReadDirResponse, error)
- func (r *Server) ReadFile(request *proto.ReadFileRequest, stream proto.Store_ReadFileServer) error
- func (r *Server) ReadFiles(request *proto.ReadFilesRequest, stream proto.Store_ReadFilesServer) error
- func (r *Server) StreamInterceptor() grpc.StreamServerInterceptor
- func (r *Server) UnaryInterceptor() grpc.UnaryServerInterceptor
- func (r *Server) UndeleteCommit(ctx context.Context, request *proto.UndeleteCommitRequest) (*proto.UndeleteCommitResponse, error)
- func (r *Server) UndeleteSet(ctx context.Context, request *proto.UndeleteSetRequest) (*proto.UndeleteSetResponse, error)
- func (r *Server) Unpin(ctx context.Context, request *proto.UnpinRequest) (*proto.UnpinResponse, error)
- type SessionLookup
- type SignedRange
- type Store
- func (s *Store) BeginCommit(ctx context.Context, set string) (*backup.CommitGrant, error)
- func (s *Store) BeginSession(ctx context.Context, set string, restore *proto.Ref, initial *retention.Policy) (*backup.Session, error)
- func (s *Store) EndSession(ctx context.Context, id string) error
- func (s *Store) Escrow() (backup.KeyEscrow, error)
- func (s *Store) Get(ctx context.Context, ref *proto.Ref) (*proto.Object, error)
- func (s *Store) Presence(ctx context.Context, set string) ([]*proto.PresenceFilter, error)
- func (s *Store) Put(ctx context.Context, up Upload) (*Receipt, error)
- func (s *Store) ReadDir(ctx context.Context, set string, dir string, notAfter time.Time) ([]*proto.TreeNode, error)
- func (s *Store) ReadFile(ctx context.Context, ref *proto.Ref, skip []uint32, ...) error
- func (s *Store) ReadFiles(ctx context.Context, files []*proto.ReadFilesEntry, objectsOnly bool, ...) error
- func (s *Store) Retention() (backup.Retention, error)
- func (s *Store) Session(ctx context.Context, id string) (*backup.Session, error)
- func (s *Store) Tree(ctx context.Context, ref *proto.Ref, maxDepth uint32, ...) error
- type Upload
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidRequest = errors.New("invalid request")
ErrInvalidRequest is a call the store cannot act on as given: a malformed ref, an object that fails validation, a ref of the wrong object type.
Functions ¶
func ArchiveKey ¶
ArchiveKey is where a BucketStore keeps the archive file name in its bucket.
func ClientTLS ¶
ClientTLS returns a client TLS configuration that trusts only the PEM certificates in caFile, or the system roots when caFile is empty.
func NewBucketObjectStore ¶
func NewBucketObjectStore(bucket *blob.Bucket, index pack.ArchiveIndex, cacheDir string, cacheSize int64, extra ...pack.PackOption) (*pack.PackStorage, error)
NewBucketObjectStore returns a pack store over a remote bucket that keeps its archives in index and, if cacheDir is not empty, a local metadata cache of at most cacheSize bytes (0 is unbounded); extra pack options follow.
func ServerTLS ¶
func ServerTLS(certFile, keyFile string, plaintextBehindProxy bool) (credentials.TransportCredentials, *tls.Config, error)
ServerTLS returns what a store server listens with: TLS from the certificate and key files, or plaintext when the operator declared a TLS-terminating proxy in front and gave neither. The TLS configuration is nil for plaintext.
func SignArchiveRange ¶
func SignArchiveRange(ctx context.Context, bucket *blob.Bucket, r SignedRange) (*proto.Location, error)
SignArchiveRange signs r against bucket, which holds archives as a BucketStore keeps them. A bucket whose driver cannot bind the range and headers answers pack.ErrNoSignedURL; only Cloud Storage binds headers beyond the range.
Types ¶
type BucketOption ¶
type BucketOption func(*BucketStore)
A BucketOption adjusts a BucketStore.
func WithStoreName ¶
func WithStoreName(name string) BucketOption
WithStoreName labels what this store sends to the object store, so the cost of one store can be told from another's in a process holding several of them.
type BucketStore ¶
type BucketStore struct {
// contains filtered or unexported fields
}
BucketStore is a pack.ArchiveStorage over a gocloud bucket, keyed pack/<extension>/<name>.
func NewBucketStore ¶
func NewBucketStore(bucket *blob.Bucket, options ...BucketOption) *BucketStore
NewBucketStore returns an archive storage over bucket.
func (*BucketStore) Checksum ¶
func (c *BucketStore) Checksum(name string) ([]byte, error)
Checksum implements pack.Checksummer with the MD5 the bucket reports, empty when it has none.
func (*BucketStore) Create ¶
func (c *BucketStore) Create(name string) (pack.File, error)
Create implements pack.ArchiveStorage.
func (*BucketStore) CreateNew ¶
func (c *BucketStore) CreateNew(name string, data []byte) error
CreateNew implements pack.ArchiveStorage with the bucket's own precondition, so it holds across processes on GCS and S3; a file:// bucket only checks within one process.
func (*BucketStore) Delete ¶
func (c *BucketStore) Delete(name string) error
Delete implements pack.ArchiveStorage.
func (*BucketStore) DeleteAll ¶
func (c *BucketStore) DeleteAll() error
DeleteAll implements pack.ArchiveStorage.
func (*BucketStore) List ¶
func (c *BucketStore) List(extension string) ([]string, error)
List implements pack.ArchiveStorage.
func (*BucketStore) ListInfo ¶
func (c *BucketStore) ListInfo(extension string) ([]pack.ListedFile, error)
ListInfo implements pack.InfoLister.
func (*BucketStore) Open ¶
func (c *BucketStore) Open(name string) (pack.File, error)
Open implements pack.ArchiveStorage.
func (*BucketStore) OpenListed ¶
func (c *BucketStore) OpenListed(file pack.ListedFile) (pack.File, error)
OpenListed implements pack.ListedOpener.
func (*BucketStore) SignRange ¶
func (c *BucketStore) SignRange(ctx context.Context, name string, offset, length int64, ttl time.Duration) (*proto.Location, error)
SignRange implements pack.RangeSigner. The URL is bound to the range, so the recipient can read those bytes and nothing else of the archive. A bucket whose driver cannot bind a header answers ErrNoSignedURL.
type Client ¶
type Client struct {
// HTTP fetches the locations a server answers with; nil uses the
// default client.
HTTP *http.Client
// contains filtered or unexported fields
}
Client is a backup.Index over a store server's gRPC API.
func NewClient ¶
NewClient connects to a store server over TLS, presenting creds on every call. A nil tlsConfig trusts the system roots; see ClientTLS for a pinned certificate authority.
func NewPlaintextClient ¶
func NewPlaintextClient(addr string, creds auth.Credentials) (*Client, error)
NewPlaintextClient connects to a store server without TLS, putting the credentials and every object on the wire in the clear. It is for a store on the same machine as the agent; anywhere else, use NewClient. The credentials must allow it.
func (*Client) BeginCommit ¶
BeginCommit implements backup.CommitGate; a refusal is ErrCommitDenied with the server's reason.
func (*Client) BeginSession ¶
BeginSession opens a session on the server and returns a context whose calls belong to it.
func (*Client) CommitInfo ¶
func (r *Client) CommitInfo(ctx context.Context, set string, notAfter time.Time, count int) ([]*proto.Commit, error)
CommitInfo implements backup.Index.
func (*Client) CommitSizes ¶
func (r *Client) CommitSizes(ctx context.Context, set string, notAfter time.Time, count int) ([]*proto.Commit, []*proto.CommitSize, error)
CommitSizes implements backup.CommitSizer. A store that measures nothing answers each commit with an empty size.
func (*Client) CountCommits ¶
func (r *Client) CountCommits(ctx context.Context, set string, period proto.Period, from, to time.Time, zone string, deleted bool) ([]*proto.CommitCount, error)
CountCommits implements backup.Retention.
func (*Client) DeleteCommit ¶
DeleteCommit implements backup.Retention.
func (*Client) Downloaded ¶
Downloaded returns how many bytes the client has received so far, from the server and from the locations it followed, as they came over the wire.
func (*Client) EndSession ¶
EndSession drops what the context's session has not committed; a session the store no longer has, such as one its commit ended, is backup.ErrNoSession.
func (*Client) EscrowedKeys ¶
EscrowedKeys returns every escrowed copy of the store key the server keeps.
func (*Client) FileInfo ¶
func (r *Client) FileInfo(ctx context.Context, set string, name string, notAfter time.Time, count int) ([]*proto.TreeNode, error)
FileInfo implements backup.Index.
func (*Client) Get ¶
Get implements backup.ObjectStore. A server that answers with a location is followed, so where the bytes came from stays its business.
func (*Client) GetTree ¶
func (r *Client) GetTree(ctx context.Context, ref *proto.Ref, maxDepth uint32) ([]*proto.Object, error)
GetTree implements backup.TreeFetcher over the streaming RPC, fetching the runs it is pointed at runFetchers at a time. It returns only trees reached from ref through the refs of trees it returns, and fails with proto.ErrRefMismatch on any other object the server sends.
func (*Client) LatestCommit ¶
LatestCommit implements backup.Index.
func (*Client) PutEscrowedKey ¶
PutEscrowedKey implements backup.KeyEscrow through the server's Admin service, which takes the same credentials as the store.
func (*Client) PutFile ¶
func (r *Client) PutFile(ctx context.Context, object *proto.Object, assumed []*proto.Ref) ([]*proto.Ref, error)
PutFile implements backup.Confirmer.
func (*Client) ReadDir ¶
func (r *Client) ReadDir(ctx context.Context, set string, dir string, notAfter time.Time) ([]*proto.TreeNode, error)
ReadDir implements backup.DirLister.
func (*Client) ReadFiles ¶
func (r *Client) ReadFiles(ctx context.Context, files []backup.FileRead, objectsOnly bool, object func(int, *proto.Object) error, part func(int, int, *proto.Object) error) error
ReadFiles implements backup.FilesReader through the ReadFiles stream, fetching the runs it is pointed at runFetchers at a time.
func (*Client) ReadParts ¶
func (r *Client) ReadParts(ctx context.Context, file *proto.Ref, skip []int, fn func(int, *proto.Object) error) error
ReadParts implements backup.PartReader through the ReadFile stream, fetching the runs it is pointed at runFetchers at a time.
func (*Client) TrashedCommits ¶
func (r *Client) TrashedCommits(ctx context.Context, set string, before time.Time, limit int) ([]*proto.TrashedCommit, error)
TrashedCommits implements backup.Retention.
func (*Client) UndeleteCommit ¶
UndeleteCommit implements backup.Retention.
func (*Client) UndeleteSet ¶
UndeleteSet implements backup.Retention.
type Operation ¶
type Operation string
Operation is a request a store makes to the object store holding it. Object stores bill by request, and each charges these differently, so they are counted apart and priced by whoever pays the bill.
const ( // OpGet reads an object or a range of one. OpGet Operation = "get" // OpHead reads an object's attributes without its body. OpHead Operation = "head" // OpPut writes an object. OpPut Operation = "put" // OpList reads one page of a listing. OpList Operation = "list" // OpDelete removes an object. OpDelete Operation = "delete" )
type Receipt ¶
Receipt answers an Upload: the stored ref, the stamped object for a commit or pin, or the assumed refs that are missing, in which case nothing was stored.
type Server ¶
type Server struct {
proto.UnsafeStoreServer
// contains filtered or unexported fields
}
Server is the gRPC adapter of a Store: every RPC is one Store operation and a translation of its errors to status codes.
func (*Server) BeginCommit ¶
func (r *Server) BeginCommit(ctx context.Context, request *proto.BeginCommitRequest) (*proto.BeginCommitResponse, error)
BeginCommit implements proto.StoreServer.
func (*Server) BeginSession ¶
func (r *Server) BeginSession(ctx context.Context, request *proto.BeginSessionRequest) (*proto.BeginSessionResponse, error)
BeginSession implements proto.StoreServer.
func (*Server) CommitInfo ¶
func (r *Server) CommitInfo(ctx context.Context, request *proto.CommitInfoRequest) (*proto.CommitInfoResponse, error)
CommitInfo implements proto.StoreServer.
func (*Server) CountCommits ¶
func (r *Server) CountCommits(ctx context.Context, request *proto.CountCommitsRequest) (*proto.CountCommitsResponse, error)
CountCommits implements proto.StoreServer.
func (*Server) DeleteCommit ¶
func (r *Server) DeleteCommit(ctx context.Context, request *proto.DeleteCommitRequest) (*proto.DeleteCommitResponse, error)
DeleteCommit implements proto.StoreServer.
func (*Server) DeleteSet ¶
func (r *Server) DeleteSet(ctx context.Context, request *proto.DeleteSetRequest) (*proto.DeleteSetResponse, error)
DeleteSet implements proto.StoreServer.
func (*Server) EndSession ¶
func (r *Server) EndSession(ctx context.Context, request *proto.EndSessionRequest) (*proto.EndSessionResponse, error)
EndSession implements proto.StoreServer.
func (*Server) EscrowedKeys ¶
func (r *Server) EscrowedKeys(ctx context.Context, _ *proto.EscrowedKeysRequest) (*proto.EscrowedKeysResponse, error)
EscrowedKeys implements proto.StoreServer.
func (*Server) FileInfo ¶
func (r *Server) FileInfo(ctx context.Context, request *proto.FileInfoRequest) (*proto.FileInfoResponse, error)
FileInfo implements proto.StoreServer.
func (*Server) Get ¶
func (r *Server) Get(ctx context.Context, request *proto.GetRequest) (*proto.GetResponse, error)
Get implements proto.StoreServer.
func (*Server) GetPresence ¶
func (r *Server) GetPresence(request *proto.GetPresenceRequest, stream proto.Store_GetPresenceServer) error
GetPresence streams the head filters of the caller's scope, each split into pieces that share an index.
func (*Server) GetTree ¶
func (r *Server) GetTree(request *proto.GetTreeRequest, stream proto.Store_GetTreeServer) error
GetTree implements proto.StoreServer.
func (*Server) LatestCommit ¶
func (r *Server) LatestCommit(ctx context.Context, request *proto.LatestCommitRequest) (*proto.LatestCommitResponse, error)
LatestCommit answers with an empty ref when the set has no commit.
func (*Server) ListPins ¶
func (r *Server) ListPins(ctx context.Context, _ *proto.ListPinsRequest) (*proto.ListPinsResponse, error)
ListPins implements proto.StoreServer.
func (*Server) ListTrash ¶
func (r *Server) ListTrash(ctx context.Context, request *proto.ListTrashRequest) (*proto.ListTrashResponse, error)
ListTrash implements proto.StoreServer.
func (*Server) Put ¶
func (r *Server) Put(ctx context.Context, request *proto.PutRequest) (*proto.PutResponse, error)
Put implements proto.StoreServer.
func (*Server) ReadDir ¶
func (r *Server) ReadDir(ctx context.Context, request *proto.ReadDirRequest) (*proto.ReadDirResponse, error)
ReadDir implements proto.StoreServer.
func (*Server) ReadFile ¶
func (r *Server) ReadFile(request *proto.ReadFileRequest, stream proto.Store_ReadFileServer) error
ReadFile streams a file's parts, as runs to fetch or as stored objects, running the loop server-side so the client authorises once per file.
func (*Server) ReadFiles ¶
func (r *Server) ReadFiles(request *proto.ReadFilesRequest, stream proto.Store_ReadFilesServer) error
ReadFiles streams many files' objects and then their parts, as runs to fetch or as stored objects.
func (*Server) StreamInterceptor ¶
func (r *Server) StreamInterceptor() grpc.StreamServerInterceptor
StreamInterceptor is UnaryInterceptor for streaming calls.
func (*Server) UnaryInterceptor ¶
func (r *Server) UnaryInterceptor() grpc.UnaryServerInterceptor
UnaryInterceptor resolves the session header; it runs after authentication.
func (*Server) UndeleteCommit ¶
func (r *Server) UndeleteCommit(ctx context.Context, request *proto.UndeleteCommitRequest) (*proto.UndeleteCommitResponse, error)
UndeleteCommit implements proto.StoreServer.
func (*Server) UndeleteSet ¶
func (r *Server) UndeleteSet(ctx context.Context, request *proto.UndeleteSetRequest) (*proto.UndeleteSetResponse, error)
UndeleteSet implements proto.StoreServer.
func (*Server) Unpin ¶
func (r *Server) Unpin(ctx context.Context, request *proto.UnpinRequest) (*proto.UnpinResponse, error)
Unpin implements proto.StoreServer.
type SessionLookup ¶
type SessionLookup interface {
LookupSession(ctx context.Context, id string) (*backup.Session, error)
}
SessionLookup resolves a session id presented by a caller.
type SignedRange ¶
type SignedRange struct {
Name string
Offset, Length int64
TTL time.Duration
Now time.Time
Header map[string]string
}
SignedRange asks for a GET of bytes [Offset, Offset+Length) of the archive Name, working for TTL from Now (zero means time.Now). Header is bound into the signature beside the range, and the request must send it as given.
type Store ¶
type Store struct {
Index backup.Index
Sessions backup.SessionStore
// Lease is what BeginSession promises the client: the session
// store's own when it has one.
Lease time.Duration
}
Store is one store's operations over an index and its sessions: the work behind every RPC of proto.Store, with no transport in it. The caller's principal and session travel in the context.
func NewStore ¶
func NewStore(index backup.Index, sessions backup.SessionStore) *Store
NewStore returns a Store over index. sessions is nil for a store without sessions.
func (*Store) BeginCommit ¶
BeginCommit asks the index whether the caller may commit to set. An index without a gate allows every commit and assigns the set id later; a refusal is backup.ErrCommitDenied with the reason.
func (*Store) BeginSession ¶
func (s *Store) BeginSession(ctx context.Context, set string, restore *proto.Ref, initial *retention.Policy) (*backup.Session, error)
BeginSession opens a session on set for the caller; restore names the commit a restore session reads, nil for a backup. initial, when set, is the retention policy set starts with if the session creates it; an invalid one is ErrInvalidRequest.
func (*Store) EndSession ¶
EndSession drops what the caller's session id has not committed.
func (*Store) Get ¶
Get fetches a commit, tree or file object the caller references. Anything else, and anything absent, is backup.ErrNotFound.
func (*Store) Presence ¶
Presence returns the head filters of the caller's scope for set: nil when the index keeps none or the scope is off.
func (*Store) Put ¶
Put stores up.Object after recomputing its ref from the received bytes; a client ref that does not match is proto.ErrRefMismatch. Commits and pins are stamped with the receipt time, and a commit with its set id, so their ref is computed here and returned with the object.
func (*Store) ReadDir ¶
func (s *Store) ReadDir(ctx context.Context, set string, dir string, notAfter time.Time) ([]*proto.TreeNode, error)
ReadDir lists what a set held directly under dir at notAfter, sorted by name; backup.ErrNotImplemented for an index that cannot answer.
func (*Store) ReadFile ¶
func (s *Store) ReadFile(ctx context.Context, ref *proto.Ref, skip []uint32, fn func(*proto.ReadFileResponse) error) error
ReadFile hands fn the file's parts except the indexes in skip: runs of them the index can locate, and the stored objects of the rest in order. An inline part is never handed over.
func (*Store) ReadFiles ¶
func (s *Store) ReadFiles(ctx context.Context, files []*proto.ReadFilesEntry, objectsOnly bool, fn func(*proto.ReadFilesResponse) error) error
ReadFiles hands fn the object of each of files in order and then, unless objectsOnly, the parts of each except the indexes in its skip, a part several of them hold once: runs of those the index can locate, all located together, and the stored objects of the rest in order. An inline part is never handed over.
func (*Store) Retention ¶
Retention is the index's retention state, backup.ErrNotImplemented for an index that keeps none.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package maintenance runs a store's housekeeping on a schedule.
|
Package maintenance runs a store's housekeeping on a schedule. |
|
Package mapping turns what the store service carries into goback's own types and back.
|
Package mapping turns what the store service carries into goback's own types and back. |
|
Package pack stores objects in archives, each with an index of what it holds, in an ArchiveStorage such as a directory or a bucket.
|
Package pack stores objects in archives, each with an index of what it holds, in an ArchiveStorage such as a directory or a bucket. |
|
Package wrapped finds the store beneath stores layered over it, such as a cache: Innermost(store) is the store that keeps the objects, to test for what it implements.
|
Package wrapped finds the store beneath stores layered over it, such as a cache: Innermost(store) is the store that keeps the objects, to test for what it implements. |