ocm_stub.go 653 B

1234567891011121314151617181920
  1. //go:build !with_ocm
  2. package include
  3. import (
  4. "context"
  5. "github.com/sagernet/sing-box/adapter"
  6. "github.com/sagernet/sing-box/adapter/service"
  7. C "github.com/sagernet/sing-box/constant"
  8. "github.com/sagernet/sing-box/log"
  9. "github.com/sagernet/sing-box/option"
  10. E "github.com/sagernet/sing/common/exceptions"
  11. )
  12. func registerOCMService(registry *service.Registry) {
  13. service.Register[option.OCMServiceOptions](registry, C.TypeOCM, func(ctx context.Context, logger log.ContextLogger, tag string, options option.OCMServiceOptions) (adapter.Service, error) {
  14. return nil, E.New(`OCM is not included in this build, rebuild with -tags with_ocm`)
  15. })
  16. }