cache : add cache service (#457)

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
Bobby DeSimone 2020-01-20 18:25:34 -08:00 committed by GitHub
parent 8a9cb0f803
commit dccc7cd2ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 1837 additions and 587 deletions

View file

@ -16,6 +16,7 @@ func Test_isValidService(t *testing.T) {
{"authenticate bad case", "AuThenticate", false},
{"authorize implemented", "authorize", true},
{"jiberish", "xd23", false},
{"cache", "cache", true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@ -27,6 +28,7 @@ func Test_isValidService(t *testing.T) {
}
func Test_isAuthenticate(t *testing.T) {
t.Parallel()
tests := []struct {
name string
service string
@ -50,6 +52,7 @@ func Test_isAuthenticate(t *testing.T) {
}
func Test_isAuthorize(t *testing.T) {
t.Parallel()
tests := []struct {
name string
service string
@ -92,3 +95,27 @@ func Test_IsProxy(t *testing.T) {
})
}
}
func Test_IsCache(t *testing.T) {
t.Parallel()
tests := []struct {
name string
service string
want bool
}{
{"proxy", "proxy", false},
{"all", "all", true},
{"authorize", "authorize", false},
{"proxy bad case", "PrOxY", false},
{"jiberish", "xd23", false},
{"cache", "cache", true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := IsCache(tt.service); got != tt.want {
t.Errorf("IsCache() = %v, want %v", got, tt.want)
}
})
}
}