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

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