github.com/sagernet/sing-box@v1.2.7/include/clashapi_stub.go (about)

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