Support clock mocking.

This addresses #15.
This commit is contained in:
2018-12-06 08:07:27 -08:00
committed by Kyle Isom
parent bbc82ff8de
commit 9e0979e07f
3 changed files with 15 additions and 2 deletions

8
Gopkg.lock generated
View File

@@ -1,6 +1,12 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/benbjohnson/clock"
packages = ["."]
revision = "7dc76406b6d3c05b5f71a86293cbcf3c4ea03b19"
[[projects]]
branch = "master"
name = "rsc.io/qr"
@@ -14,6 +20,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "b705d306da5a78e76b7ff289744770eef56328a4f0d1c615c1a233d056283651"
inputs-digest = "6f47334a8fcf2bb48e739e6181089e02bce6cc4d68888be311df3827db96f8ae"
solver-name = "gps-cdcl"
solver-version = 1

View File

@@ -32,3 +32,7 @@
[prune]
go-tests = true
unused-packages = true
[[constraint]]
branch = "master"
name = "github.com/benbjohnson/clock"

View File

@@ -11,9 +11,12 @@ import (
"net/url"
"strconv"
"strings"
"time"
"github.com/benbjohnson/clock"
)
var time clock.Clock
// TOTP represents an RFC 6238 Time-based One-Time Password instance.
type TOTP struct {
*OATH