mirror of https://github.com/v2ray/v2ray-core
				
				
				
			fix typo, first sound of user is not a vowel, but the consonant /j/
							parent
							
								
									4de3f1adc1
								
							
						
					
					
						commit
						a58063e7ac
					
				|  | @ -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) | ||||
| } | ||||
|  |  | |||
|  | @ -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 | ||||
| } | ||||
|  |  | |||
|  | @ -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 { | ||||
|  |  | |||
|  | @ -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
	
	 wuxiangzhou2010
						wuxiangzhou2010