all repos — captcha @ 4b8382af1554c4a28cf9819998a1e99b48908281

Go package captcha implements generation and verification of image and audio CAPTCHAs.

Remove "Std" from StdCollectNum and StdExpiration.
Dmitry Chestnykh dmitry@codingrobots.com
Mon, 25 Apr 2011 23:35:53 +0200
commit

4b8382af1554c4a28cf9819998a1e99b48908281

parent

dab967324bac3f9d55fb1664840f86df7643ec5a

2 files changed, 8 insertions(+), 7 deletions(-)

jump to
M captcha.gocaptcha.go

@@ -16,17 +16,18 @@

const ( // Standard number of digits in captcha. StdLength = 6 - // The number of captchas created that triggers garbage collection. - StdCollectNum = 100 - // Expiration time of captchas. - StdExpiration = 10 * 60 // 10 minutes + // The number of captchas created that triggers garbage collection used + // by default store. + CollectNum = 100 + // Expiration time of captchas used by default store. + Expiration = 10 * 60 // 10 minutes ) var ErrNotFound = os.NewError("captcha with the given id not found") // globalStore is a shared storage for captchas, generated by New function. -var globalStore = NewMemoryStore(StdCollectNum, StdExpiration) +var globalStore = NewMemoryStore(CollectNum, Expiration) // SetCustomStore sets custom storage for captchas. func SetCustomStore(s Store) {
M store_test.gostore_test.go

@@ -7,7 +7,7 @@ "testing"

) func TestSetGet(t *testing.T) { - s := NewMemoryStore(StdCollectNum, StdExpiration) + s := NewMemoryStore(CollectNum, Expiration) id := "captcha id" d := RandomDigits(10) s.Set(id, d)

@@ -18,7 +18,7 @@ }

} func TestGetClear(t *testing.T) { - s := NewMemoryStore(StdCollectNum, StdExpiration) + s := NewMemoryStore(CollectNum, Expiration) id := "captcha id" d := RandomDigits(10) s.Set(id, d)