notify/serialization.go

32 lines
575 B
Go
Raw Permalink Normal View History

2020-07-17 09:54:37 +08:00
package notify
import "b612.me/notify/internal/codec"
2020-07-17 09:54:37 +08:00
func Register(data interface{}) {
codec.Register(data)
2020-07-17 09:54:37 +08:00
}
2023-02-03 13:24:52 +08:00
func RegisterName(name string, data interface{}) {
codec.RegisterName(name, data)
2023-02-03 13:24:52 +08:00
}
2020-07-17 09:54:37 +08:00
func RegisterAll(data []interface{}) {
codec.RegisterAll(data)
2020-07-17 09:54:37 +08:00
}
2023-02-03 13:24:52 +08:00
func RegisterNames(data map[string]interface{}) {
codec.RegisterNames(data)
2023-02-03 13:24:52 +08:00
}
2020-07-17 09:54:37 +08:00
func encode(src interface{}) ([]byte, error) {
return codec.Encode(src)
2020-07-17 09:54:37 +08:00
}
2021-11-12 16:04:39 +08:00
func Encode(src interface{}) ([]byte, error) {
return codec.Encode(src)
2021-11-12 16:04:39 +08:00
}
2020-07-17 09:54:37 +08:00
func Decode(src []byte) (interface{}, error) {
return codec.Decode(src)
2020-07-17 09:54:37 +08:00
}