admin

package
v1.65.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Status

func Status(err error) error

Status maps the index's sentinel errors to gRPC codes; an error that already is a status passes through.

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

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.

Directories

Path Synopsis
Package mapping turns what the index reports into the admin protos.
Package mapping turns what the index reports into the admin protos.
gen

Jump to

Keyboard shortcuts

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