Added GetExpireInterval() method to DB.

This commit is contained in:
Alexander Andreev 2022-06-26 15:44:41 +04:00
parent f0ced332e8
commit c5d159531c
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

@ -17,6 +17,7 @@ type ICaptchaDB interface {
Image(id ID) (*image.Image, error) Image(id ID) (*image.Image, error)
Solve(id ID, answer Answer) (bool, error) Solve(id ID, answer Answer) (bool, error)
IsSolved(id ID) bool IsSolved(id ID) bool
GetExpireInterval() time.Duration
} }
type CaptchaDB struct { type CaptchaDB struct {
@ -102,3 +103,7 @@ func (cdb *CaptchaDB) IsSolved(id ID) (bool, error) {
} }
return false, errorNotFound return false, errorNotFound
} }
func (cdb *CaptchaDB) GetExpireInterval() time.Duration {
return cdb.ExpireInterval
}