Documentation
¶
Overview ¶
Package admin implements the Admin service of a store server: sets, the store policy, retention, escrow and job triggers. The server serves it beside the Store service, behind the same credentials.
Index ¶
- func Status(err error) error
- type Index
- type Server
- func (s *Server) CollectGarbage(ctx context.Context, _ *pb.CollectGarbageRequest) (*pb.CollectGarbageResponse, error)
- func (s *Server) DeleteSet(ctx context.Context, request *pb.DeleteSetRequest) (*pb.DeleteSetResponse, error)
- func (s *Server) GetRetention(ctx context.Context, request *pb.GetRetentionRequest) (*pb.Retention, error)
- func (s *Server) GetStorePolicy(ctx context.Context, _ *pb.GetStorePolicyRequest) (*pb.StorePolicy, error)
- func (s *Server) ListSets(ctx context.Context, request *pb.ListSetsRequest) (*pb.ListSetsResponse, error)
- func (s *Server) PutEscrowedKey(ctx context.Context, request *pb.PutEscrowedKeyRequest) (*pb.PutEscrowedKeyResponse, error)
- func (s *Server) Retire(ctx context.Context, _ *pb.RetireRequest) (*pb.RetireResponse, error)
- func (s *Server) SetRetention(ctx context.Context, request *pb.SetRetentionRequest) (*pb.Retention, error)
- func (s *Server) SetStorePolicy(ctx context.Context, request *pb.SetStorePolicyRequest) (*pb.StorePolicy, error)
- func (s *Server) UndeleteSet(ctx context.Context, request *pb.UndeleteSetRequest) (*pb.UndeleteSetResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Index ¶
type Index interface {
ListSets(ctx context.Context) ([]index.SetInfo, error)
DeleteSet(ctx context.Context, name string, erase bool) error
UndeleteSet(ctx context.Context, name string) error
GetStorePolicy(ctx context.Context) (index.StorePolicy, error)
SetStorePolicy(ctx context.Context, policy storekey.Policy, acknowledge bool, now time.Time) (index.StorePolicy, error)
GetPolicy(ctx context.Context, set string) (index.SetRetention, error)
SetPolicy(ctx context.Context, set string, p *retention.Policy) error
GetDefaultPolicy(ctx context.Context) (retention.Policy, bool, error)
SetDefaultPolicy(ctx context.Context, p *retention.Policy) error
Windows(ctx context.Context) (index.Windows, error)
SetWindows(ctx context.Context, w index.Windows) error
}
Index is what the admin surface needs from a store's index.
type Server ¶
type Server struct {
pb.UnimplementedAdminServer
Index Index
// RetireJob and CollectJob run the retention and garbage collection
// jobs; nil means the job is not available.
RetireJob func(ctx context.Context) (int, error)
CollectJob func(ctx context.Context) (string, error)
// Escrow keeps the escrowed store key; nil means the store keeps none.
Escrow backup.KeyEscrow
// Now is the clock; nil means time.Now.
Now func() time.Time
}
Server implements the Admin service over a store index.
func (*Server) CollectGarbage ¶
func (s *Server) CollectGarbage(ctx context.Context, _ *pb.CollectGarbageRequest) (*pb.CollectGarbageResponse, error)
CollectGarbage implements pb.AdminServer.
func (*Server) DeleteSet ¶
func (s *Server) DeleteSet(ctx context.Context, request *pb.DeleteSetRequest) (*pb.DeleteSetResponse, error)
DeleteSet implements pb.AdminServer.
func (*Server) GetRetention ¶
func (s *Server) GetRetention(ctx context.Context, request *pb.GetRetentionRequest) (*pb.Retention, error)
GetRetention implements pb.AdminServer.
func (*Server) GetStorePolicy ¶
func (s *Server) GetStorePolicy(ctx context.Context, _ *pb.GetStorePolicyRequest) (*pb.StorePolicy, error)
GetStorePolicy implements pb.AdminServer.
func (*Server) ListSets ¶
func (s *Server) ListSets(ctx context.Context, request *pb.ListSetsRequest) (*pb.ListSetsResponse, error)
ListSets implements pb.AdminServer.
func (*Server) PutEscrowedKey ¶
func (s *Server) PutEscrowedKey(ctx context.Context, request *pb.PutEscrowedKeyRequest) (*pb.PutEscrowedKeyResponse, error)
PutEscrowedKey implements pb.AdminServer.
func (*Server) Retire ¶
func (s *Server) Retire(ctx context.Context, _ *pb.RetireRequest) (*pb.RetireResponse, error)
Retire implements pb.AdminServer.
func (*Server) SetRetention ¶
func (s *Server) SetRetention(ctx context.Context, request *pb.SetRetentionRequest) (*pb.Retention, error)
SetRetention implements pb.AdminServer.
func (*Server) SetStorePolicy ¶
func (s *Server) SetStorePolicy(ctx context.Context, request *pb.SetStorePolicyRequest) (*pb.StorePolicy, error)
SetStorePolicy implements pb.AdminServer.
func (*Server) UndeleteSet ¶
func (s *Server) UndeleteSet(ctx context.Context, request *pb.UndeleteSetRequest) (*pb.UndeleteSetResponse, error)
UndeleteSet implements pb.AdminServer.