manager_stub.go 898 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //go:build !with_script
  2. package script
  3. import (
  4. "context"
  5. "github.com/sagernet/sing-box/adapter"
  6. "github.com/sagernet/sing-box/log"
  7. "github.com/sagernet/sing-box/option"
  8. E "github.com/sagernet/sing/common/exceptions"
  9. )
  10. var _ adapter.ScriptManager = (*Manager)(nil)
  11. type Manager struct{}
  12. func NewManager(ctx context.Context, logFactory log.Factory, scripts []option.Script) (*Manager, error) {
  13. if len(scripts) > 0 {
  14. return nil, E.New(`script is not included in this build, rebuild with -tags with_script`)
  15. }
  16. return (*Manager)(nil), nil
  17. }
  18. func (m *Manager) Start(stage adapter.StartStage) error {
  19. return nil
  20. }
  21. func (m *Manager) Close() error {
  22. return nil
  23. }
  24. func (m *Manager) Scripts() []adapter.Script {
  25. return nil
  26. }
  27. func (m *Manager) Script(name string) (adapter.Script, bool) {
  28. return nil, false
  29. }
  30. func (m *Manager) SurgeCache() *adapter.SurgeInMemoryCache {
  31. return nil
  32. }