sing-box/experimental/daemon/interface.go
2022-08-25 11:07:41 +08:00

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
}