mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-10 11:03:13 +00:00
16 lines
234 B
Go
16 lines
234 B
Go
|
package adapter
|
||
|
|
||
|
type PreStarter interface {
|
||
|
PreStart() error
|
||
|
}
|
||
|
|
||
|
func PreStart(starter any) error {
|
||
|
if preService, ok := starter.(PreStarter); ok {
|
||
|
err := preService.PreStart()
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
}
|
||
|
return nil
|
||
|
}
|