summaryrefslogtreecommitdiff
path: root/check.go
diff options
context:
space:
mode:
Diffstat (limited to 'check.go')
-rw-r--r--check.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/check.go b/check.go
index f66813e..be329e7 100644
--- a/check.go
+++ b/check.go
@@ -14,6 +14,16 @@ func init() {
rand.Seed(time.Now().UnixNano())
}
+func Keys() chan string {
+ keys := make(chan string)
+ go func() {
+ for {
+ keys <- Key()
+ }
+ }()
+ return keys
+}
+
func Key() string {
b := make([]byte, 16)
for i := range b {
@@ -22,8 +32,7 @@ func Key() string {
return hex.EncodeToString(b[:])
}
-func Check(uri string) error {
- key := Key()
+func Check(uri, key string) error {
resp, err := http.Get(uri + "?key=" + key)
if err != nil {
return err