service

package
v0.0.0-...-8deeed5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2021 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

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

func Reload

func Reload() error

func Start

func Start() (err error)

Types

type AddUserHandle

type AddUserHandle func(*model.UserInfo)

type DelUserHandle

type DelUserHandle func(int)

type Limit

type Limit struct {
	// contains filtered or unexported fields
}

func GetLimitInstance

func GetLimitInstance() *Limit

func NewLimit

func NewLimit() *Limit

func (*Limit) Del

func (l *Limit) Del(uid int)

func (*Limit) DownLimit

func (l *Limit) DownLimit(uid, n int) error

func (*Limit) Set

func (l *Limit) Set(uid int, limition int)

func (*Limit) UpLimit

func (l *Limit) UpLimit(uid, n int) error

func (*Limit) Wait

func (l *Limit) Wait(uid, n int) error

type RuleItemComiled

type RuleItemComiled struct {
	model.RuleItem
	// contains filtered or unexported fields
}

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) Load

func (r *RuleService) Load(rule *model.Rule)

RuleService load rule

func (*RuleService) LoadFromApi

func (r *RuleService) LoadFromApi() error

func (*RuleService) Reset

func (r *RuleService) Reset()

RuleService set all field to default.

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) AddUser

func (s *SSRManager) AddUser(user *model.UserInfo) error

func (*SSRManager) AddUsers

func (s *SSRManager) AddUsers(users []*model.UserInfo) error

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) EditUser

func (s *SSRManager) EditUser(user *model.UserInfo) error

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL