Changes
4 changed files (+13/-31)
-
-
@@ -156,8 +156,8 @@ // This mapping may be nested inside the actor document as the value or may be a link// to a JSON-LD document with these properties. Endpoints *Endpoints `jsonld:"endpoints,omitempty"` // A list of supplementary Collections which may be of interest. Streams []ItemCollection `jsonld:"streams,omitempty"` PublicKey PublicKey `jsonld:"publicKey,omitempty"` Streams ItemCollection `jsonld:"streams,omitempty"` PublicKey PublicKey `jsonld:"publicKey,omitempty"` } // GetID returns the ID corresponding to the current Actor
-
@@ -396,11 +396,7 @@ }} if len(a.Streams) > 0 { writePropJSONName(&b, "streams") lNotEmpty := true for _, ss := range a.Streams { lNotEmpty = writeItemCollectionJSONValue(&b, ss) || lNotEmpty } notEmpty = lNotEmpty || notEmpty notEmpty = notEmpty || writeItemCollectionJSONValue(&b, a.Streams) } if len(a.PublicKey.PublicKeyPem)+len(a.PublicKey.ID) > 0 { if v, err := a.PublicKey.MarshalJSON(); err == nil && len(v) > 0 {
-
-
-
@@ -73,11 +73,11 @@ if err = a.Endpoints.GobDecode(raw); err != nil {return err } } //if raw, ok := mm["streams"]; ok { // if err = a.Streams.GobDecode(raw); err != nil { // return err // } //} if raw, ok := mm["streams"]; ok { if a.Streams, err = gobDecodeItems(raw); err != nil { return err } } if raw, ok := mm["publicKey"]; ok { if err = a.PublicKey.GobDecode(raw); err != nil { return err
-
-
-
@@ -132,11 +132,6 @@ loadPublicKey(val, &key)return key } func JSONGetStreams(val *fastjson.Value, prop string) []ItemCollection { // TODO(marius) return nil } func itemsFn(val *fastjson.Value) (Item, error) { if val.Type() == fastjson.TypeArray { it := val.GetArray()
-
@@ -512,7 +507,7 @@ a.Inbox = JSONGetItem(val, "inbox")a.Outbox = JSONGetItem(val, "outbox") a.Liked = JSONGetItem(val, "liked") a.Endpoints = JSONGetActorEndpoints(val, "endpoints") a.Streams = JSONGetStreams(val, "streams") a.Streams = JSONGetItems(val, "streams") a.PublicKey = JSONGetPublicKey(val, "publicKey") return nil }
-
-
-
@@ -47,15 +47,6 @@ }return b.Bytes(), nil } func gobEncodeBytes(s []byte) ([]byte, error) { b := bytes.Buffer{} gg := gob.NewEncoder(&b) if err := gg.Encode(s); err != nil { return nil, err } return b.Bytes(), nil } func gobEncodeStringLikeType(g *gob.Encoder, s []byte) error { if err := g.Encode(s); err != nil { return err
-
@@ -459,10 +450,10 @@ }hasData = true } if len(a.Streams) > 0 { //if mm["streams"], err = gobDecodeItem(a.Streams); err != nil { // return hasData, err //} //hasData = true if mm["streams"], err = gobEncodeItems(a.Streams); err != nil { return hasData, err } hasData = true } if len(a.PublicKey.PublicKeyPem)+len(a.PublicKey.ID) > 0 { if mm["publicKey"], err = a.PublicKey.GobEncode(); err != nil {
-