mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
Merge branch 'master' of github.com:v2ray/v2ray-core into domainsocket
This commit is contained in:
Regular → Executable
+4
-7
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
// InboundOperation is the interface for operations that applies to inbound handlers.
|
||||
type InboundOperation interface {
|
||||
// ApplyInbound appliess this operation to the given inbound handler.
|
||||
// ApplyInbound applies this operation to the given inbound handler.
|
||||
ApplyInbound(context.Context, core.InboundHandler) error
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
@@ -139,10 +139,7 @@ func (s *service) Register(server *grpc.Server) {
|
||||
|
||||
func init() {
|
||||
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, cfg interface{}) (interface{}, error) {
|
||||
s := core.FromContext(ctx)
|
||||
if s == nil {
|
||||
return nil, newError("V is not in context.")
|
||||
}
|
||||
s := core.MustFromContext(ctx)
|
||||
return &service{v: s}, nil
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ import v2ray_core_common_serial "v2ray.com/core/common/serial"
|
||||
import v2ray_core "v2ray.com/core"
|
||||
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
"context"
|
||||
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user