server

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompatLegacyGetServerConfigRequest

type CompatLegacyGetServerConfigRequest struct {
	CompatLegacyServerCommon
}

type CompatLegacyGetServerConfigResponse

type CompatLegacyGetServerConfigResponse struct {
	Basic    CompatLegacyServerBasic `json:"basic"`
	Protocol string                  `json:"protocol"`
	Config   interface{}             `json:"config"`
}

type CompatLegacyGetServerUserListRequest

type CompatLegacyGetServerUserListRequest struct {
	CompatLegacyServerCommon
}

type CompatLegacyGetServerUserListResponse

type CompatLegacyGetServerUserListResponse struct {
	Users []CompatLegacyServerUser `json:"users"`
}

type CompatLegacyNodeConfig

type CompatLegacyNodeConfig struct {
	NodeSecret             string
	NodePullInterval       int64
	NodePushInterval       int64
	TrafficReportThreshold int64
	IPStrategy             string
	DNS                    string
	Block                  string
	Outbound               string
}

type CompatLegacyNodeDNS

type CompatLegacyNodeDNS struct {
	Proto   string   `json:"proto"`
	Address string   `json:"address"`
	Domains []string `json:"domains"`
}

type CompatLegacyNodeOutbound

type CompatLegacyNodeOutbound struct {
	Name     string   `json:"name"`
	Protocol string   `json:"protocol"`
	Address  string   `json:"address"`
	Port     int64    `json:"port"`
	Password string   `json:"password"`
	Rules    []string `json:"rules"`
}

type CompatLegacyOnlineUser

type CompatLegacyOnlineUser struct {
	SID int64
	IP  string
}

type CompatLegacyProvider

type CompatLegacyProvider interface {
	DB() *ent.Client
	Redis() redis.UniversalClient
	Queue() *asynq.Client
	AppNodeConfig() *conf.Node
	LoadNodeConfig(ctx context.Context, module string) (*CompatLegacyNodeConfig, error)
}

type CompatLegacyPushOnlineUsersRequest

type CompatLegacyPushOnlineUsersRequest struct {
	CompatLegacyServerCommon
	Users []CompatLegacyOnlineUser
}

type CompatLegacyPushServerStatusRequest

type CompatLegacyPushServerStatusRequest struct {
	CompatLegacyServerCommon
	CPU       float64
	Mem       float64
	Disk      float64
	UpdatedAt int64
}

type CompatLegacyPushUserTrafficRequest

type CompatLegacyPushUserTrafficRequest struct {
	CompatLegacyServerCommon
	Traffic []CompatLegacyUserTraffic
}

type CompatLegacyQueryServerConfigRequest

type CompatLegacyQueryServerConfigRequest struct {
	ServerID  int64
	SecretKey string
	Protocols []string
}

type CompatLegacyQueryServerConfigResponse

type CompatLegacyQueryServerConfigResponse struct {
	TrafficReportThreshold int64                      `json:"traffic_report_threshold"`
	IPStrategy             string                     `json:"ip_strategy"`
	DNS                    []CompatLegacyNodeDNS      `json:"dns"`
	Block                  []string                   `json:"block"`
	Outbound               []CompatLegacyNodeOutbound `json:"outbound"`
	Protocols              []*servermodel.Protocol    `json:"protocols"`
	Total                  int64                      `json:"total"`
}

type CompatLegacyServerBasic

type CompatLegacyServerBasic struct {
	PushInterval           int64  `json:"push_interval"`
	PullInterval           int64  `json:"pull_interval"`
	DeviceCountMode        string `json:"device_count_mode,omitempty"`
	DeviceAdmissionEnabled bool   `json:"device_admission_enabled,omitempty"`
}

type CompatLegacyServerCommon

type CompatLegacyServerCommon struct {
	Protocol  string
	ServerID  int64
	Port      uint16
	SecretKey string
}

type CompatLegacyServerUser

type CompatLegacyServerUser struct {
	ID          int64  `json:"id"`
	UUID        string `json:"uuid"`
	SpeedLimit  int64  `json:"speed_limit"`
	DeviceLimit int64  `json:"device_limit"`
}

type CompatLegacyUserTraffic

type CompatLegacyUserTraffic struct {
	SID      int64
	Upload   int64
	Download int64
}

type ServerService

type ServerService struct {
	v1.UnimplementedServerServer
	// contains filtered or unexported fields
}

ServerService 节点服务器服务

func NewServerService

func NewServerService(uc *serverBiz.ServerNodeUsecase, logger log.Logger) *ServerService

NewServerService 创建节点服务器服务

func (*ServerService) CompatGetServerConfig

func (*ServerService) CompatPushOnlineUsers

func (s *ServerService) CompatPushOnlineUsers(ctx context.Context, provider CompatLegacyProvider, req *CompatLegacyPushOnlineUsersRequest) error

func (*ServerService) CompatPushServerStatus

func (s *ServerService) CompatPushServerStatus(ctx context.Context, provider CompatLegacyProvider, req *CompatLegacyPushServerStatusRequest) error

func (*ServerService) CompatPushUserTraffic

func (s *ServerService) CompatPushUserTraffic(ctx context.Context, provider CompatLegacyProvider, req *CompatLegacyPushUserTrafficRequest) error

func (*ServerService) CompatV1ServerSecretAllowed

func (s *ServerService) CompatV1ServerSecretAllowed(ctx context.Context, provider CompatLegacyProvider, provided string) bool

func (*ServerService) CompatV2ServerSecretAllowed

func (s *ServerService) CompatV2ServerSecretAllowed(ctx context.Context, provider CompatLegacyProvider, provided string) bool

func (*ServerService) GetServerConfig

GetServerConfig 获取服务器配置

func (*ServerService) GetServerUserList

GetServerUserList 获取服务器用户列表

func (*ServerService) PushOnlineUsers

PushOnlineUsers 推送在线用户

func (*ServerService) PushServerStatus

PushServerStatus 推送服务器状态

func (*ServerService) PushUserTraffic

PushUserTraffic 推送用户流量

func (*ServerService) QueryServerProtocolConfig

QueryServerProtocolConfig 查询服务器协议配置

func (*ServerService) SessionCheck

SessionCheck 会话准入检查

func (*ServerService) SessionRelease

SessionRelease 会话释放

Jump to

Keyboard shortcuts

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