mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-04 12:27:37 +03:00
31 lines
519 B
Go
31 lines
519 B
Go
package shadowsocks
|
|
|
|
import (
|
|
"context"
|
|
|
|
E "github.com/sagernet/sing/common/exceptions"
|
|
M "github.com/sagernet/sing/common/metadata"
|
|
"github.com/sagernet/sing/protocol/socks"
|
|
)
|
|
|
|
type Service interface {
|
|
M.TCPConnectionHandler
|
|
socks.UDPHandler
|
|
}
|
|
|
|
type Handler interface {
|
|
M.TCPConnectionHandler
|
|
socks.UDPConnectionHandler
|
|
E.Handler
|
|
}
|
|
|
|
type MultiUserService[U comparable] interface {
|
|
Service
|
|
AddUser(user U, key []byte)
|
|
RemoveUser(user U)
|
|
}
|
|
|
|
type UserContext[U comparable] struct {
|
|
context.Context
|
|
User U
|
|
}
|