github.com/goplus/gossa@v0.3.25/pkg/runtime/metrics/go118_export.go (about)

     1  // export by github.com/goplus/gossa/cmd/qexp
     2  
     3  //go:build go1.18
     4  // +build go1.18
     5  
     6  package metrics
     7  
     8  import (
     9  	q "runtime/metrics"
    10  
    11  	"go/constant"
    12  	"reflect"
    13  
    14  	"github.com/goplus/gossa"
    15  )
    16  
    17  func init() {
    18  	gossa.RegisterPackage(&gossa.Package{
    19  		Name: "metrics",
    20  		Path: "runtime/metrics",
    21  		Deps: map[string]string{
    22  			"math":    "math",
    23  			"runtime": "runtime",
    24  			"unsafe":  "unsafe",
    25  		},
    26  		Interfaces: map[string]reflect.Type{},
    27  		NamedTypes: map[string]gossa.NamedType{
    28  			"Description":      {reflect.TypeOf((*q.Description)(nil)).Elem(), "", ""},
    29  			"Float64Histogram": {reflect.TypeOf((*q.Float64Histogram)(nil)).Elem(), "", ""},
    30  			"Sample":           {reflect.TypeOf((*q.Sample)(nil)).Elem(), "", ""},
    31  			"Value":            {reflect.TypeOf((*q.Value)(nil)).Elem(), "Float64,Float64Histogram,Kind,Uint64", ""},
    32  			"ValueKind":        {reflect.TypeOf((*q.ValueKind)(nil)).Elem(), "", ""},
    33  		},
    34  		AliasTypes: map[string]reflect.Type{},
    35  		Vars:       map[string]reflect.Value{},
    36  		Funcs: map[string]reflect.Value{
    37  			"All":  reflect.ValueOf(q.All),
    38  			"Read": reflect.ValueOf(q.Read),
    39  		},
    40  		TypedConsts: map[string]gossa.TypedConst{
    41  			"KindBad":              {reflect.TypeOf(q.KindBad), constant.MakeInt64(int64(q.KindBad))},
    42  			"KindFloat64":          {reflect.TypeOf(q.KindFloat64), constant.MakeInt64(int64(q.KindFloat64))},
    43  			"KindFloat64Histogram": {reflect.TypeOf(q.KindFloat64Histogram), constant.MakeInt64(int64(q.KindFloat64Histogram))},
    44  			"KindUint64":           {reflect.TypeOf(q.KindUint64), constant.MakeInt64(int64(q.KindUint64))},
    45  		},
    46  		UntypedConsts: map[string]gossa.UntypedConst{},
    47  	})
    48  }