|
|
|
@@ -1,15 +1,14 @@ |
|
|
|
package event |
|
|
|
|
|
|
|
import ( |
|
|
|
"gitlink.org.cn/cloudream/common/pkgs/types" |
|
|
|
myreflect "gitlink.org.cn/cloudream/common/utils/reflect" |
|
|
|
"gitlink.org.cn/cloudream/common/utils/serder" |
|
|
|
) |
|
|
|
|
|
|
|
type Event interface{} |
|
|
|
|
|
|
|
var eventUnionEles = serder.NewTypeNameResolver(true) |
|
|
|
var EventTypeUnino = serder.NewTypeUnion[Event]("@type", eventUnionEles) |
|
|
|
var EventTypeUnino = types.NewTypeUnion[Event]() |
|
|
|
|
|
|
|
func Register[T any]() { |
|
|
|
eventUnionEles.Register(myreflect.TypeOf[T]()) |
|
|
|
EventTypeUnino.Add(myreflect.TypeOf[T]()) |
|
|
|
} |