Is your feature request related to a problem? Please describe.
I want to customize serializer, need a defined interface in order to better readability or better performance
// EncodeSchedulerEnqueueEvent marshals the given event
// and returns an encoded bytes.
func EncodeSchedulerEnqueueEvent(event *SchedulerEnqueueEvent) ([]byte, error) {
if event == nil {
return nil, fmt.Errorf("cannot encode nil enqueue event")
}
enqueuedAt, err := ptypes.TimestampProto(event.EnqueuedAt)
if err != nil {
return nil, err
}
return proto.Marshal(&pb.SchedulerEnqueueEvent{
TaskId: event.TaskID,
EnqueueTime: enqueuedAt,
})
}
Describe the solution you'd like
type Serializer interface{
func Marshal(v any) ([]byte, error)
func Unmarshal(data []byte, v any) error
}
Is your feature request related to a problem? Please describe. I want to customize serializer, need a defined interface in order to better readability or better performance
Describe the solution you'd like
so that, I can write my serializer.