2023-06-07 13:18:56 -04:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
2023-07-29 07:27:15 -04:00
|
|
|
"github.com/InazumaV/V2bX/api/panel"
|
|
|
|
"github.com/InazumaV/V2bX/conf"
|
2023-06-07 13:18:56 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
type AddUsersParams struct {
|
2023-08-19 08:06:42 -04:00
|
|
|
Tag string
|
|
|
|
Users []panel.UserInfo
|
|
|
|
*panel.NodeInfo
|
2023-06-07 13:18:56 -04:00
|
|
|
}
|
2023-08-19 08:06:42 -04:00
|
|
|
|
2023-06-07 13:18:56 -04:00
|
|
|
type Core interface {
|
|
|
|
Start() error
|
|
|
|
Close() error
|
2023-07-29 06:47:47 -04:00
|
|
|
AddNode(tag string, info *panel.NodeInfo, config *conf.Options) error
|
2023-06-07 13:18:56 -04:00
|
|
|
DelNode(tag string) error
|
|
|
|
AddUsers(p *AddUsersParams) (added int, err error)
|
2023-06-08 10:46:33 -04:00
|
|
|
GetUserTraffic(tag, uuid string, reset bool) (up int64, down int64)
|
2025-01-10 02:33:05 -05:00
|
|
|
DelUsers(users []panel.UserInfo, tag string, info *panel.NodeInfo) error
|
2023-06-09 09:20:41 -04:00
|
|
|
Protocols() []string
|
2023-08-20 03:13:52 -04:00
|
|
|
Type() string
|
2023-06-07 13:18:56 -04:00
|
|
|
}
|