Documentation ¶
Index ¶
- Constants
- type Handler
- type SCTFeedback
- type SCTFeedbackEntry
- type STHPollination
- type STHVersion
- type SignatureVerifierMap
- type Storage
- func (s *Storage) AddSCTFeedback(feedback SCTFeedback) (err error)
- func (s *Storage) AddSTHPollination(pollination STHPollination) error
- func (s *Storage) Close() error
- func (s *Storage) GetRandomSTHPollination(newerThan time.Time, limit int) (*STHPollination, error)
- func (s *Storage) Open(dbPath string) error
Constants ¶
const ( STHVersion0 = 0 STHVersion1 = 1 )
STHVersion constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler for the gossip HTTP requests.
func NewHandler ¶
func NewHandler(s *Storage, v SignatureVerifierMap) Handler
NewHandler creates a new Handler object, taking a pointer a Storage object to use for storing and retrieving feedback and pollination data, and a SignatureVerifierMap for verifying signatures from known logs.
func (*Handler) HandleSCTFeedback ¶
func (h *Handler) HandleSCTFeedback(rw http.ResponseWriter, req *http.Request)
HandleSCTFeedback handles requests POSTed to .../sct-feedback. It attempts to store the provided SCT Feedback
func (*Handler) HandleSTHPollination ¶
func (h *Handler) HandleSTHPollination(rw http.ResponseWriter, req *http.Request)
HandleSTHPollination handles requests POSTed to .../sth-pollination. It attempts to store the provided pollination info, and returns a random set of pollination data from the last 14 days (i.e. "fresh" by the definition of the gossip RFC.)
type SCTFeedback ¶
type SCTFeedback struct {
Feedback []SCTFeedbackEntry `json:"sct_feedback"`
}
SCTFeedback represents a collection of SCTFeedback which a client might send together.
type SCTFeedbackEntry ¶
type SCTFeedbackEntry struct { X509Chain []string `json:"x509_chain"` SCTData []string `json:"sct_data"` }
SCTFeedbackEntry represents a single piece of SCT feedback.
type STHPollination ¶
type STHPollination struct {
STHs []ct.SignedTreeHead `json:"sths"`
}
STHPollination represents a collection of STH pollination entries which a client might send together.
type SignatureVerifierMap ¶
type SignatureVerifierMap map[ct.SHA256Hash]ct.SignatureVerifier
SignatureVerifierMap is a map of SignatureVerifier by LogID
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage provides an SQLite3-backed method for persisting gossip data
func (*Storage) AddSCTFeedback ¶
func (s *Storage) AddSCTFeedback(feedback SCTFeedback) (err error)
AddSCTFeedback stores the passed in feedback object.
func (*Storage) AddSTHPollination ¶
func (s *Storage) AddSTHPollination(pollination STHPollination) error
AddSTHPollination stores the passed in pollination object.
func (*Storage) GetRandomSTHPollination ¶
GetRandomSTHPollination returns a random selection of "fresh" (i.e. at most 14 days old) STHs from the pool.