Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartFakeAdminServer ¶
func StartFakeAdminServer(server *FakeAdminServer) (net.Listener, func(), error)
StartFakeAdminServer starts a FakeAdminServer on a random port. Returns the started server, the listener it's using for connection and a close function that must be defer-called on the scope the server is meant to stop.
Types ¶
type FakeAdminServer ¶
type FakeAdminServer struct { trillian.TrillianAdminServer // Err will be returned by CreateTree if not nil. Err error // GeneratedKey will be used to set a tree's PrivateKey if a CreateTree request has a KeySpec. // This is for simulating key generation. GeneratedKey *any.Any }
FakeAdminServer implements the TrillianAdminServer CreateTree RPC. The remaining RPCs are not implemented.
func (*FakeAdminServer) CreateTree ¶
func (s *FakeAdminServer) CreateTree(ctx context.Context, req *trillian.CreateTreeRequest) (*trillian.Tree, error)
CreateTree returns req.Tree, unless s.Err is not nil, in which case it returns s.Err. This allows tests to examine the requested tree and check behavior under error conditions. If s.GeneratedKey and req.KeySpec are not nil, the returned tree will have its PrivateKey field set to s.GeneratedKey.
Click to show internal directories.
Click to hide internal directories.