Documentation ¶
Index ¶
- type MalleableTestDB
- func (s *MalleableTestDB) AddCert(logID int64, cert *SubmittedCert) error
- func (s *MalleableTestDB) GetIndex(logID int64) (int64, error)
- func (s *MalleableTestDB) GetRandSeen(logID int64) (*SubmittedCert, error)
- func (s *MalleableTestDB) GetUnseen(logID int64) ([]SubmittedCert, error)
- func (s *MalleableTestDB) MarkCertSeen(id int, seen time.Time) error
- func (s *MalleableTestDB) UpdateIndex(logID int64, index int64) error
- type Storage
- type SubmittedCert
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MalleableTestDB ¶
type MalleableTestDB struct { AddCertFunc func(int64, *SubmittedCert) error GetUnseenFunc func(int64) ([]SubmittedCert, error) GetRandSeenFunc func(logID int64) (*SubmittedCert, error) MarkCertSeenFunc func(int, time.Time) error GetIndexFunc func(int64) (int64, error) UpdateIndexFunc func(int64, int64) error }
MalleableTestDB is a mock database client used for testing. It is exported so it can be used in other packages when we don't want to use an actual database for tests.
func (*MalleableTestDB) AddCert ¶
func (s *MalleableTestDB) AddCert(logID int64, cert *SubmittedCert) error
func (*MalleableTestDB) GetRandSeen ¶
func (s *MalleableTestDB) GetRandSeen(logID int64) (*SubmittedCert, error)
func (*MalleableTestDB) GetUnseen ¶
func (s *MalleableTestDB) GetUnseen(logID int64) ([]SubmittedCert, error)
func (*MalleableTestDB) MarkCertSeen ¶
func (s *MalleableTestDB) MarkCertSeen(id int, seen time.Time) error
func (*MalleableTestDB) UpdateIndex ¶
func (s *MalleableTestDB) UpdateIndex(logID int64, index int64) error
type Storage ¶
type Storage interface { AddCert(logID int64, cert *SubmittedCert) error GetUnseen(logID int64) ([]SubmittedCert, error) GetRandSeen(logID int64) (*SubmittedCert, error) MarkCertSeen(id int, seen time.Time) error GetIndex(logID int64) (int64, error) UpdateIndex(logID int64, index int64) error }
Storage provides methods for interacting with a database
Click to show internal directories.
Click to hide internal directories.