libs5-go/metadata/media_metadata_details.go

35 lines
683 B
Go
Raw Normal View History

2024-01-05 13:58:13 +00:00
package metadata
2024-03-01 05:18:07 +00:00
import (
"errors"
"github.com/vmihailenco/msgpack/v5"
)
var (
_ msgpack.CustomDecoder = (*MediaMetadataDetails)(nil)
_ msgpack.CustomEncoder = (*MediaMetadataDetails)(nil)
)
2024-01-05 13:58:13 +00:00
type MediaMetadataDetails struct {
Data map[int]interface{}
}
func NewMediaMetadataDetails(data map[int]interface{}) *MediaMetadataDetails {
return &MediaMetadataDetails{Data: data}
}
2024-03-01 05:18:07 +00:00
func (mmd *MediaMetadataDetails) EncodeMsgpack(enc *msgpack.Encoder) error {
return errors.New("Not implemented")
}
func (mmd *MediaMetadataDetails) DecodeMsgpack(dec *msgpack.Decoder) error {
2024-03-01 07:55:45 +00:00
intMap, err := decodeIntMap(dec)
2024-03-01 05:18:07 +00:00
if err != nil {
return err
}
2024-03-01 07:55:45 +00:00
mmd.Data = intMap
2024-03-01 05:18:07 +00:00
return nil
}