mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 21:54:13 +08:00
Create service_interface.go
Signed-off-by: david_feng <385297@qq.com>
This commit is contained in:
parent
c2b7d5bd12
commit
ead13161e3
23
experimental/libbox/service_interface.go
Normal file
23
experimental/libbox/service_interface.go
Normal file
@ -0,0 +1,23 @@
|
||||
package libbox
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
box "github.com/sagernet/sing-box"
|
||||
"github.com/sagernet/sing-box/common/urltest"
|
||||
"github.com/sagernet/sing/service/pause"
|
||||
)
|
||||
|
||||
func NewBoxService(ctx context.Context, cancel context.CancelFunc, instance *box.Box, pauseManager pause.Manager, urlTestHistoryStorage *urltest.HistoryStorage) BoxService {
|
||||
return BoxService{
|
||||
ctx: ctx,
|
||||
cancel: cancel,
|
||||
instance: instance,
|
||||
pauseManager: pauseManager,
|
||||
urlTestHistoryStorage: urlTestHistoryStorage,
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BoxService) GetInstance() *box.Box {
|
||||
return b.instance
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user