Browse Source

Remove "Std" from StdCollectNum and StdExpiration.

Dmitry Chestnykh 14 years ago
parent
commit
4b8382af15
2 changed files with 8 additions and 7 deletions
  1. 6 5
      captcha.go
  2. 2 2
      store_test.go

+ 6 - 5
captcha.go

@@ -16,17 +16,18 @@ import (
 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) {

+ 2 - 2
store_test.go

@@ -7,7 +7,7 @@ import (
 )
 
 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 TestSetGet(t *testing.T) {
 }
 
 func TestGetClear(t *testing.T) {
-	s := NewMemoryStore(StdCollectNum, StdExpiration)
+	s := NewMemoryStore(CollectNum, Expiration)
 	id := "captcha id"
 	d := RandomDigits(10)
 	s.Set(id, d)