Documentation ¶
Overview ¶
Package admin contains the TrillianAdminServer implementation.
Index ¶
- type DeletedTreeGC
- type Server
- func (s *Server) CreateTree(ctx context.Context, req *trillian.CreateTreeRequest) (*trillian.Tree, error)
- func (s *Server) DeleteTree(ctx context.Context, req *trillian.DeleteTreeRequest) (*trillian.Tree, error)
- func (s *Server) GetTree(ctx context.Context, req *trillian.GetTreeRequest) (*trillian.Tree, error)
- func (s *Server) IsHealthy() error
- func (s *Server) ListTrees(ctx context.Context, req *trillian.ListTreesRequest) (*trillian.ListTreesResponse, error)
- func (s *Server) UndeleteTree(ctx context.Context, req *trillian.UndeleteTreeRequest) (*trillian.Tree, error)
- func (s *Server) UpdateTree(ctx context.Context, req *trillian.UpdateTreeRequest) (*trillian.Tree, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeletedTreeGC ¶ added in v1.0.2
type DeletedTreeGC struct {
// contains filtered or unexported fields
}
DeletedTreeGC garbage collects deleted trees.
Tree deletion goes through two separate stages: * Soft deletion, which "flips a bit" (see Tree.Deleted) but otherwise leaves the tree unaltered * Hard deletion, which effectively removes all tree data
DeletedTreeGC performs the transition from soft to hard deletion. Trees that have been deleted for at least DeletedThreshold are eligible for garbage collection.
func NewDeletedTreeGC ¶ added in v1.0.2
func NewDeletedTreeGC(admin storage.AdminStorage, threshold, minRunInterval time.Duration, mf monitoring.MetricFactory) *DeletedTreeGC
NewDeletedTreeGC returns a new DeletedTreeGC.
func (*DeletedTreeGC) Run ¶ added in v1.0.2
func (gc *DeletedTreeGC) Run(ctx context.Context)
Run starts the tree garbage collection process. It runs until ctx is cancelled.
func (*DeletedTreeGC) RunOnce ¶ added in v1.0.2
func (gc *DeletedTreeGC) RunOnce(ctx context.Context) (int, error)
RunOnce performs a single tree garbage collection sweep. Returns the number of successfully deleted trees.
It attempts to delete as many eligible trees as possible, regardless of failures. If it encounters any failures while deleting the resulting error is non-nil.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an implementation of trillian.TrillianAdminServer.
func New ¶
New returns a trillian.TrillianAdminServer implementation. registry is the extension.Registry used by the Server. allowedTreeTypes defines which tree types may be created through this server, with nil meaning unrestricted.
func (*Server) CreateTree ¶
func (s *Server) CreateTree(ctx context.Context, req *trillian.CreateTreeRequest) (*trillian.Tree, error)
CreateTree implements trillian.TrillianAdminServer.CreateTree.
func (*Server) DeleteTree ¶
func (s *Server) DeleteTree(ctx context.Context, req *trillian.DeleteTreeRequest) (*trillian.Tree, error)
DeleteTree implements trillian.TrillianAdminServer.DeleteTree.
func (*Server) IsHealthy ¶
IsHealthy returns nil if the server is healthy, error otherwise. TODO(Martin2112): This method (and the one in the log server) should probably have ctx as a param
func (*Server) ListTrees ¶
func (s *Server) ListTrees(ctx context.Context, req *trillian.ListTreesRequest) (*trillian.ListTreesResponse, error)
ListTrees implements trillian.TrillianAdminServer.ListTrees.
func (*Server) UndeleteTree ¶ added in v1.0.2
func (s *Server) UndeleteTree(ctx context.Context, req *trillian.UndeleteTreeRequest) (*trillian.Tree, error)
UndeleteTree implements trillian.TrillianAdminServer.UndeleteTree.
func (*Server) UpdateTree ¶
func (s *Server) UpdateTree(ctx context.Context, req *trillian.UpdateTreeRequest) (*trillian.Tree, error)
UpdateTree implements trillian.TrillianAdminServer.UpdateTree.