1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-01 23:16:23 -05:00

fix typo, first sound of user is not a vowel, but the consonant /j/

This commit is contained in:
wuxiangzhou2010 2018-04-02 15:17:36 +08:00
parent 4de3f1adc1
commit a58063e7ac
4 changed files with 6 additions and 6 deletions

4
app/proxyman/command/command.go Normal file → Executable file
View File

@ -37,7 +37,7 @@ func (op *AddUserOperation) ApplyInbound(ctx context.Context, handler core.Inbou
} }
um, ok := p.(proxy.UserManager) um, ok := p.(proxy.UserManager)
if !ok { if !ok {
return newError("proxy is not an UserManager") return newError("proxy is not a UserManager")
} }
return um.AddUser(ctx, op.User) return um.AddUser(ctx, op.User)
} }
@ -50,7 +50,7 @@ func (op *RemoveUserOperation) ApplyInbound(ctx context.Context, handler core.In
} }
um, ok := p.(proxy.UserManager) um, ok := p.(proxy.UserManager)
if !ok { if !ok {
return newError("proxy is not an UserManager") return newError("proxy is not a UserManager")
} }
return um.RemoveUser(ctx, op.Email) return um.RemoveUser(ctx, op.Email)
} }

2
common/protocol/account.go Normal file → Executable file
View File

@ -1,6 +1,6 @@
package protocol package protocol
// Account is an user identity used for authentication. // Account is a user identity used for authentication.
type Account interface { type Account interface {
Equals(Account) bool Equals(Account) bool
} }

4
common/protocol/context.go Normal file → Executable file
View File

@ -10,12 +10,12 @@ const (
userKey key = iota userKey key = iota
) )
// ContextWithUser returns a context combined with an User. // ContextWithUser returns a context combined with a User.
func ContextWithUser(ctx context.Context, user *User) context.Context { func ContextWithUser(ctx context.Context, user *User) context.Context {
return context.WithValue(ctx, userKey, user) return context.WithValue(ctx, userKey, user)
} }
// UserFromContext extracts an User from the given context, if any. // UserFromContext extracts a User from the given context, if any.
func UserFromContext(ctx context.Context) *User { func UserFromContext(ctx context.Context) *User {
v := ctx.Value(userKey) v := ctx.Value(userKey)
if v == nil { if v == nil {

2
proxy/proxy.go Normal file → Executable file
View File

@ -41,7 +41,7 @@ type UserManager interface {
// AddUser adds a new user. // AddUser adds a new user.
AddUser(context.Context, *protocol.User) error AddUser(context.Context, *protocol.User) error
// RemoveUser removes an user by email. // RemoveUser removes a user by email.
RemoveUser(context.Context, string) error RemoveUser(context.Context, string) error
} }