Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ type Backend interface {
type ConfigKey struct{}

type UsersKey struct{}

// LimitEnforcer interface for traffic limit enforcement
type LimitEnforcer interface {
Start(ctx context.Context, refreshInterval interface{})
Stop()
ResetUserTraffic(userID int)
ResetAllTraffic()
}
49 changes: 43 additions & 6 deletions common/service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions common/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ message Backend {
repeated User users = 3;
uint64 keep_alive = 4;
repeated string exclude_inbounds = 5;

// Limit enforcer configuration (sent from panel)
int32 node_id = 6;
string panel_api_url = 7;
int32 limit_check_interval = 8; // seconds, default 30
int32 limit_refresh_interval = 9; // seconds, default 60
}

// log
Expand Down
30 changes: 15 additions & 15 deletions common/service_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading