Documentation ¶
Index ¶
- type NonceDb
- func (ndb *NonceDb) Add(nonce string, delta int64, aux interface{}) *NonceObj
- func (ndb *NonceDb) AddAux(nonce string, aux interface{}) bool
- func (ndb *NonceDb) DeleteOld()
- func (ndb *NonceDb) DeleteOldOportunistic()
- func (ndb *NonceDb) New(delta int64, aux interface{}) *NonceObj
- func (ndb *NonceDb) Search(nonce string) (*NonceObj, bool)
- func (ndb *NonceDb) SearchAndDelete(nonce string) (*NonceObj, bool)
- type NonceObj
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NonceDb ¶
type NonceDb struct {
// contains filtered or unexported fields
}
NonceDb is a collection of nonces with expiration dates.
func (*NonceDb) AddAux ¶
AddAux adds aux data to a nonceObj only if it doesn't have an Aux already. Returns true on success.
func (*NonceDb) DeleteOld ¶
func (ndb *NonceDb) DeleteOld()
DeleteOld deletes all the expired nonces.
func (*NonceDb) DeleteOldOportunistic ¶
func (ndb *NonceDb) DeleteOldOportunistic()
DeleteOldOportunistic deletes expired nonces once every N calls (where N is 128 for now).
func (*NonceDb) New ¶
New adds a new nonce to the db that expires after delta seconds, and returns the added NonceObj
Click to show internal directories.
Click to hide internal directories.