store.go 826 B

12345678910111213141516171819202122
  1. package store
  2. // Store An object implementing Store interface can be registered with SetCustomStore
  3. // function to handle storage and retrieval of captcha ids and solutions for
  4. // them, replacing the default memory store.
  5. //
  6. // It is the responsibility of an object to delete expired and used captchas
  7. // when necessary (for example, the default memory store collects them in Set
  8. // method after the certain amount of captchas has been stored.)
  9. type Store interface {
  10. // Set sets the digits for the captcha id.
  11. Set(id string, digits []byte)
  12. // Get returns stored digits for the captcha id. Clear indicates
  13. // whether the captcha must be deleted from the store.
  14. Get(id string, clear bool) (digits []byte)
  15. }
  16. // Logger Define the log output interface
  17. type Logger interface {
  18. Printf(format string, args ...interface{})
  19. }