container: split into reader+writer

This commit is contained in:
Michael Muré
2024-10-02 11:56:32 +02:00
parent f7b4b48791
commit 60922ced96
7 changed files with 485 additions and 439 deletions

View File

@@ -123,6 +123,22 @@ func (m *Meta) Add(key string, val any) error {
return nil
}
// Equals tells if two Meta hold the same key/values.
func (m *Meta) Equals(other *Meta) bool {
if len(m.Keys) != len(other.Keys) {
return false
}
if len(m.Values) != len(other.Values) {
return false
}
for _, key := range m.Keys {
if !ipld.DeepEqual(m.Values[key], other.Values[key]) {
return false
}
}
return true
}
func fqtn(val any) string {
var name string