예제 #1
0
파일: integer.go 프로젝트: cronosun/buranv1
func integerRegister(registry btesting.HandlerRegistry) {
	registry.AddHandler(reflect.TypeOf(int(0)), Integer)
	registry.AddHandler(reflect.TypeOf(int8(0)), Integer)
	registry.AddHandler(reflect.TypeOf(int16(0)), Integer)
	registry.AddHandler(reflect.TypeOf(int32(0)), Integer)
	registry.AddHandler(reflect.TypeOf(int64(0)), Integer)

	registry.AddHandler(reflect.TypeOf(uint(0)), Integer)
	registry.AddHandler(reflect.TypeOf(uint8(0)), Integer)
	registry.AddHandler(reflect.TypeOf(uint16(0)), Integer)
	registry.AddHandler(reflect.TypeOf(uint32(0)), Integer)
	registry.AddHandler(reflect.TypeOf(uint64(0)), Integer)
}
예제 #2
0
func Register(registry btesting.HandlerRegistry) {

	var evalFunction btesting.EvalFunction = nil
	registry.AddHandler(reflect.TypeOf(evalFunction), Eval)

	registry.AddHandler(reflect.TypeOf(btesting.Object{}), Object)
	registry.AddHandler(reflect.TypeOf(btesting.Array{}), Array)
	registry.AddHandler(reflect.TypeOf(""), String)
	registry.AddHandler(reflect.TypeOf(typing.Key{}), Key)
	registry.AddHandler(reflect.TypeOf([]byte{}), ByteSlice)

	integerRegister(registry)

	registry.SetDefaultHandler(Default)
}