Documentation ¶
Index ¶
- Constants
- func Reload() error
- func Start() (err error)
- type AddUserHandle
- type DelUserHandle
- type Limit
- type RuleItemComiled
- type RuleService
- type SSRManager
- func (s *SSRManager) AddUser(user *model.UserInfo) error
- func (s *SSRManager) AddUsers(users []*model.UserInfo) error
- func (s *SSRManager) Close() error
- func (s *SSRManager) DelUser(uid int) error
- func (s *SSRManager) DelUsers(uids []int) error
- func (s *SSRManager) Download(port int, n int64)
- func (s *SSRManager) EditUser(user *model.UserInfo) error
- func (s *SSRManager) GetUids() []int
- func (s *SSRManager) GetUserByPort(port int) (user *model.UserInfo, exist bool)
- func (s *SSRManager) GetUserFromPort(port int) *model.UserInfo
- func (s *SSRManager) GetUserList() []*model.UserInfo
- func (s *SSRManager) NewShadowsocksRProxy(port int, method, passwd, protocol, protocolParam, obfs, obfsParam string, ...) *server.ShadowsocksRProxy
- func (s *SSRManager) Online(port int, ip string)
- func (s *SSRManager) PortToUid(port int) int
- func (s *SSRManager) RegisterAddUserHandle(handle AddUserHandle)
- func (s *SSRManager) RegisterDelUserHandle(handle DelUserHandle)
- func (s *SSRManager) Reload() error
- func (s *SSRManager) ReportNodeStatus() model.NodeStatus
- func (s *SSRManager) ReportOnline() []*model.NodeOnline
- func (s *SSRManager) ReportTask()
- func (s *SSRManager) ReportTraffic() []*model.UserTraffic
- func (s *SSRManager) Start() error
- func (s *SSRManager) UIDToPort(uid int) int
- func (s *SSRManager) Upload(port int, n int64)
Constants ¶
View Source
const ( RULE_TYPE_REG = "reg" RULE_TYPE_DOMAIN = "domain" RULE_TYPE_IP = "ip" RULE_MODE_ALLOW = "allow" RULE_MODE_REJECT = "reject" RULE_MODE_ALL = "all" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddUserHandle ¶
type DelUserHandle ¶
type DelUserHandle func(int)
type Limit ¶
type Limit struct {
// contains filtered or unexported fields
}
func GetLimitInstance ¶
func GetLimitInstance() *Limit
type RuleItemComiled ¶
type RuleService ¶
type RuleService struct {
// contains filtered or unexported fields
}
func GetRuleService ¶
func GetRuleService() *RuleService
func NewRuleService ¶
func NewRuleService() *RuleService
func (*RuleService) JudgeHostWithReport ¶
func (r *RuleService) JudgeHostWithReport(ipOrDomain string, port int) bool
func (*RuleService) LoadFromApi ¶
func (r *RuleService) LoadFromApi() error
type SSRManager ¶
type SSRManager struct { sync.Locker Shadowsocksrs map[int]*server.ShadowsocksRProxy UpTime time.Time context.Context // contains filtered or unexported fields }
func GetSSRManager ¶
func GetSSRManager() *SSRManager
func NewShadowsocksrService ¶
func NewShadowsocksrService() *SSRManager
func (*SSRManager) Close ¶
func (s *SSRManager) Close() error
func (*SSRManager) DelUser ¶
func (s *SSRManager) DelUser(uid int) error
func (*SSRManager) DelUsers ¶
func (s *SSRManager) DelUsers(uids []int) error
func (*SSRManager) Download ¶
func (s *SSRManager) Download(port int, n int64)
func (*SSRManager) GetUids ¶
func (s *SSRManager) GetUids() []int
func (*SSRManager) GetUserByPort ¶
func (s *SSRManager) GetUserByPort(port int) (user *model.UserInfo, exist bool)
func (*SSRManager) GetUserFromPort ¶
func (s *SSRManager) GetUserFromPort(port int) *model.UserInfo
func (*SSRManager) GetUserList ¶
func (s *SSRManager) GetUserList() []*model.UserInfo
func (*SSRManager) NewShadowsocksRProxy ¶
func (s *SSRManager) NewShadowsocksRProxy(port int, method, passwd, protocol, protocolParam, obfs, obfsParam string, single int, args *server.ShadowsocksRArgs) *server.ShadowsocksRProxy
func (*SSRManager) Online ¶
func (s *SSRManager) Online(port int, ip string)
func (*SSRManager) PortToUid ¶
func (s *SSRManager) PortToUid(port int) int
func (*SSRManager) RegisterAddUserHandle ¶
func (s *SSRManager) RegisterAddUserHandle(handle AddUserHandle)
func (*SSRManager) RegisterDelUserHandle ¶
func (s *SSRManager) RegisterDelUserHandle(handle DelUserHandle)
func (*SSRManager) Reload ¶
func (s *SSRManager) Reload() error
func (*SSRManager) ReportNodeStatus ¶
func (s *SSRManager) ReportNodeStatus() model.NodeStatus
func (*SSRManager) ReportOnline ¶
func (s *SSRManager) ReportOnline() []*model.NodeOnline
func (*SSRManager) ReportTask ¶
func (s *SSRManager) ReportTask()
func (*SSRManager) ReportTraffic ¶
func (s *SSRManager) ReportTraffic() []*model.UserTraffic
func (*SSRManager) Start ¶
func (s *SSRManager) Start() error
func (*SSRManager) UIDToPort ¶
func (s *SSRManager) UIDToPort(uid int) int
func (*SSRManager) Upload ¶
func (s *SSRManager) Upload(port int, n int64)
Click to show internal directories.
Click to hide internal directories.