clashapi_stub.go 563 B

12345678910111213141516171819
  1. //go:build !with_clash_api
  2. package include
  3. import (
  4. "context"
  5. "github.com/sagernet/sing-box/adapter"
  6. "github.com/sagernet/sing-box/experimental"
  7. "github.com/sagernet/sing-box/log"
  8. "github.com/sagernet/sing-box/option"
  9. E "github.com/sagernet/sing/common/exceptions"
  10. )
  11. func init() {
  12. experimental.RegisterClashServerConstructor(func(ctx context.Context, logFactory log.ObservableFactory, options option.ClashAPIOptions) (adapter.ClashServer, error) {
  13. return nil, E.New(`clash api is not included in this build, rebuild with -tags with_clash_api`)
  14. })
  15. }