mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-23 17:11:29 +00:00
21 lines
353 B
Go
21 lines
353 B
Go
package daemon
|
|
|
|
import "github.com/kardianos/service"
|
|
|
|
type Interface struct {
|
|
server *Server
|
|
}
|
|
|
|
func NewInterface(options Options) *Interface {
|
|
return &Interface{NewServer(options)}
|
|
}
|
|
|
|
func (d *Interface) Start(_ service.Service) error {
|
|
return d.server.Start()
|
|
}
|
|
|
|
func (d *Interface) Stop(_ service.Service) error {
|
|
d.server.Close()
|
|
return nil
|
|
}
|