move the STK generation from the ServerConfig to a separate struct

This commit is contained in:
Marten Seemann
2017-05-13 11:47:36 +08:00
parent 6cc6d49a10
commit 9562df5838
7 changed files with 86 additions and 21 deletions

View File

@@ -43,7 +43,6 @@ var _ = Describe("Source Address Tokens", func() {
Context("source", func() {
var (
source *stkSource
secret []byte
ip4 net.IP
ip6 net.IP
)
@@ -56,8 +55,7 @@ var _ = Describe("Source Address Tokens", func() {
ip6 = net.ParseIP("2001:0db8:0000:0000:0000:ff00:0042:8329")
Expect(ip6).NotTo(BeEmpty())
secret = []byte("TESTING")
sourceI, err := NewStkSource(secret)
sourceI, err := NewStkSource()
source = sourceI.(*stkSource)
Expect(err).NotTo(HaveOccurred())
})