-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bbf160
commit 0cc16e4
Showing
7 changed files
with
246 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package options | ||
|
||
type Certificate func(o *certificateOpt) | ||
|
||
func DNS(dns ...string) Certificate { | ||
return func(o *certificateOpt) { | ||
o.DNS = dns | ||
} | ||
} | ||
|
||
func InvalidDates() Certificate { | ||
return func(o *certificateOpt) { | ||
o.InvalidDates = true | ||
} | ||
} | ||
|
||
type certificateOpt struct { | ||
DNS []string | ||
InvalidDates bool | ||
} | ||
|
||
func ParseCertificateOptions(opts ...Certificate) (opt certificateOpt) { | ||
for _, o := range opts { | ||
o(&opt) | ||
} | ||
return opt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package framework | ||
|
||
import ( | ||
"fmt" | ||
"math/rand" | ||
) | ||
|
||
func AppendStringMap(src, add map[string]string) map[string]string { | ||
out := make(map[string]string) | ||
for k, v := range src { | ||
out[k] = v | ||
} | ||
for k, v := range add { | ||
out[k] = v | ||
} | ||
return out | ||
} | ||
|
||
func RandomHostName() string { | ||
return fmt.Sprintf("host-%08d.local", rand.Intn(1e8)) | ||
} |
Oops, something went wrong.