2020-07-17 09:54:37 +08:00
|
|
|
package notify
|
|
|
|
|
|
2026-04-15 15:24:36 +08:00
|
|
|
import "b612.me/notify/internal/codec"
|
2020-07-17 09:54:37 +08:00
|
|
|
|
|
|
|
|
func Register(data interface{}) {
|
2026-04-15 15:24:36 +08:00
|
|
|
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{}) {
|
2026-04-15 15:24:36 +08:00
|
|
|
codec.RegisterName(name, data)
|
2023-02-03 13:24:52 +08:00
|
|
|
}
|
|
|
|
|
|
2020-07-17 09:54:37 +08:00
|
|
|
func RegisterAll(data []interface{}) {
|
2026-04-15 15:24:36 +08:00
|
|
|
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{}) {
|
2026-04-15 15:24:36 +08:00
|
|
|
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) {
|
2026-04-15 15:24:36 +08:00
|
|
|
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) {
|
2026-04-15 15:24:36 +08:00
|
|
|
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) {
|
2026-04-15 15:24:36 +08:00
|
|
|
return codec.Decode(src)
|
2020-07-17 09:54:37 +08:00
|
|
|
}
|