mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
fix typo, first sound of user is not a vowel, but the consonant /j/
This commit is contained in:
parent
4de3f1adc1
commit
a58063e7ac
4
app/proxyman/command/command.go
Normal file → Executable file
4
app/proxyman/command/command.go
Normal file → Executable file
@ -37,7 +37,7 @@ func (op *AddUserOperation) ApplyInbound(ctx context.Context, handler core.Inbou
|
||||
}
|
||||
um, ok := p.(proxy.UserManager)
|
||||
if !ok {
|
||||
return newError("proxy is not an UserManager")
|
||||
return newError("proxy is not a UserManager")
|
||||
}
|
||||
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)
|
||||
if !ok {
|
||||
return newError("proxy is not an UserManager")
|
||||
return newError("proxy is not a UserManager")
|
||||
}
|
||||
return um.RemoveUser(ctx, op.Email)
|
||||
}
|
||||
|
2
common/protocol/account.go
Normal file → Executable file
2
common/protocol/account.go
Normal file → Executable file
@ -1,6 +1,6 @@
|
||||
package protocol
|
||||
|
||||
// Account is an user identity used for authentication.
|
||||
// Account is a user identity used for authentication.
|
||||
type Account interface {
|
||||
Equals(Account) bool
|
||||
}
|
||||
|
4
common/protocol/context.go
Normal file → Executable file
4
common/protocol/context.go
Normal file → Executable file
@ -10,12 +10,12 @@ const (
|
||||
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 {
|
||||
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 {
|
||||
v := ctx.Value(userKey)
|
||||
if v == nil {
|
||||
|
2
proxy/proxy.go
Normal file → Executable file
2
proxy/proxy.go
Normal file → Executable file
@ -41,7 +41,7 @@ type UserManager interface {
|
||||
// AddUser adds a new user.
|
||||
AddUser(context.Context, *protocol.User) error
|
||||
|
||||
// RemoveUser removes an user by email.
|
||||
// RemoveUser removes a user by email.
|
||||
RemoveUser(context.Context, string) error
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user