separate type define (#975)

This commit is contained in:
田欧
2017-07-05 15:47:36 +08:00
committed by Bo-Yi Wu
parent 22fc0284e3
commit d535fcd598
6 changed files with 125 additions and 133 deletions

18
auth.go
View File

@ -13,15 +13,15 @@ import (
// AuthUserKey is the cookie name for user credential in basic auth
const AuthUserKey = "user"
type (
// Accounts defines a key/value for user/pass list of authorized logins
Accounts map[string]string
authPair struct {
Value string
User string
}
authPairs []authPair
)
// Accounts defines a key/value for user/pass list of authorized logins
type Accounts map[string]string
type authPair struct {
Value string
User string
}
type authPairs []authPair
func (a authPairs) searchCredential(authValue string) (string, bool) {
if len(authValue) == 0 {