Remove "Std" from StdCollectNum and StdExpiration.
Dmitry Chestnykh dmitry@codingrobots.com
Mon, 25 Apr 2011 23:35:53 +0200
2 files changed,
8 insertions(+),
7 deletions(-)
M
captcha.go
→
captcha.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.go
→
store_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)