admin

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 15 Imported by: 12

Documentation

Overview

Package admin contains the TrillianAdminServer implementation.

Index

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

func New(registry extension.Registry, allowedTreeTypes []trillian.TreeType) *Server

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) GetTree

func (s *Server) GetTree(ctx context.Context, req *trillian.GetTreeRequest) (*trillian.Tree, error)

GetTree implements trillian.TrillianAdminServer.GetTree.

func (*Server) IsHealthy

func (s *Server) IsHealthy() error

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

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.

Jump to

Keyboard shortcuts

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