gitee.com/zhongguo168a/gocodes@v0.0.0-20230609140523-e1828349603f/datax/modifyx/iface.go (about)

     1  package modifyx
     2  
     3  type IRoot interface {
     4  	IObject
     5  
     6  	RefClassId() string
     7  	// Kind/Id
     8  	RefClassKey() string
     9  	RefClassCatalog() string
    10  	RefClassType() string
    11  	RefDispose()
    12  	// 设置修正的默认的上下文
    13  	// 如果运行时需要指定的上下文,可通过 RefSource直接操作数据源
    14  	RefSetContext(ctx interface{})
    15  	RefSource() *Source
    16  }
    17  
    18  type IObject interface {
    19  	RefOrigin(field string) interface{}
    20  	RefInt(field string) (val int)
    21  	RefUint(field string) (val uint)
    22  	RefFloat64(field string) (val float64)
    23  	RefString(field string) (val string)
    24  	RefBool(field string) (val bool)
    25  	RefMap(field string) (r IObject)
    26  	RefObject(field string) (r IObject)
    27  	RefArray(field string) (r IArray)
    28  	RefIsNil() bool
    29  	RefKeys() (r []string)
    30  	RefLength() int
    31  	RefClassCreator(field string, creator func(object IObject) IObject)
    32  	RefAnyType() string
    33  }
    34  
    35  type IArray interface {
    36  	RefInt(index int) (val int)
    37  	RefUint(index int) (val uint)
    38  	RefFloat64(index int) (val float64)
    39  	RefString(index int) (val string)
    40  	RefBool(index int) (val bool)
    41  	RefObject(index int) (r IObject)
    42  	RefLength() int
    43  }