diff options
Diffstat (limited to 'pkg/monitor/messages.go')
-rw-r--r-- | pkg/monitor/messages.go | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pkg/monitor/messages.go b/pkg/monitor/messages.go new file mode 100644 index 0000000..717aae6 --- /dev/null +++ b/pkg/monitor/messages.go @@ -0,0 +1,40 @@ +package monitor + +import ( + ct "github.com/google/certificate-transparency-go" + "gitlab.torproject.org/rgdd/ct/pkg/metadata" +) + +// MessageLogConfig provides information about a log the monitor is downloading +type MessageLogConfig struct { + Metadata metadata.Log + State MonitorState +} + +// MessageLogProgress is the next log state and any encountered leaves that were +// considered matching since the previous log state. Parse errors are included. +type MessageLogProgress struct { + State MonitorState + Matches []LogEntry + Errors []error +} + +// MonitorState describes the monitor's state for a particular log. The signed tree +// head is the latest verified append-only state that was observed. The index +// is the next leaf which will be downloaded and processed by the monitor. +type MonitorState struct { + LogState + NextIndex uint64 +} + +// LogState describes the state of a log +type LogState struct { + ct.SignedTreeHead +} + +// LogEntry is a leaf in a log's Merkle tree +type LogEntry struct { + LeafIndex uint64 + LeafData []byte + ExtraData []byte +} |