Documentation ¶
Overview ¶
Package signer is a sample implementation of a commit-log based signer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeDatabase ¶
type FakeDatabase struct {
// contains filtered or unexported fields
}
FakeDatabase simulates a local database
func (*FakeDatabase) AddLeaves ¶
func (f *FakeDatabase) AddLeaves(when int64, offset int, leaves []string) STH
AddLeaves simulates adding leaves to the local database. It returns the STH in the database.
func (*FakeDatabase) Size ¶
func (f *FakeDatabase) Size() int
Size returns the tree size of the local database
type STH ¶
type STH struct { TreeSize int `json:"sz"` TimeStamp int64 `json:"tm"` // Store the offset that the STH is supposed to appear at. Entries where this // does not match the actual offset should be ignored. Offset int `json:"off"` }
STH is a signed tree head.
type STHInfo ¶
type STHInfo struct {
// contains filtered or unexported fields
}
STHInfo holds information about an STH stored in the STH topic.
type Signer ¶
type Signer struct { Name string // contains filtered or unexported fields }
Signer is a simulated signer instance.
func New ¶
func New(name string, election *simelection.Election, epoch int64) *Signer
New creates a simulated signer that uses the provided election.
func (*Signer) LatestSTHInfo ¶
LatestSTHInfo returns the most recent STHInfo known about by the signer
func (*Signer) StoreSTHInfo ¶
StoreSTHInfo updates the STHInfo known about by the signer.
Click to show internal directories.
Click to hide internal directories.