stub.go 1.0 KB

123456789101112131415161718192021222324252627
  1. //go:build !linux
  2. package resolved
  3. import (
  4. "context"
  5. "github.com/sagernet/sing-box/adapter"
  6. boxService "github.com/sagernet/sing-box/adapter/service"
  7. C "github.com/sagernet/sing-box/constant"
  8. "github.com/sagernet/sing-box/dns"
  9. "github.com/sagernet/sing-box/log"
  10. "github.com/sagernet/sing-box/option"
  11. E "github.com/sagernet/sing/common/exceptions"
  12. )
  13. func RegisterService(registry *boxService.Registry) {
  14. boxService.Register[option.ResolvedServiceOptions](registry, C.TypeResolved, func(ctx context.Context, logger log.ContextLogger, tag string, options option.ResolvedServiceOptions) (adapter.Service, error) {
  15. return nil, E.New("resolved service is only supported on Linux")
  16. })
  17. }
  18. func RegisterTransport(registry *dns.TransportRegistry) {
  19. dns.RegisterTransport[option.ResolvedDNSServerOptions](registry, C.TypeResolved, func(ctx context.Context, logger log.ContextLogger, tag string, options option.ResolvedDNSServerOptions) (adapter.DNSTransport, error) {
  20. return nil, E.New("resolved DNS server is only supported on Linux")
  21. })
  22. }