Authentication-Results: mail-b.sr.ht; dkim=pass header.d=federated.id header.i=@federated.id; dkim=pass header.d=purelymail.com header.i=@purelymail.com Received: from sendmail.purelymail.com (sendmail.purelymail.com [34.202.193.197]) by mail-b.sr.ht (Postfix) with ESMTPS id D03F911EF49 for <~mariusor/activitypub-go@lists.sr.ht>; Fri, 22 Jul 2022 08:15:46 +0000 (UTC) DKIM-Signature: a=rsa-sha256; b=km74WIC08rfEo64Q2yYd5rd87YiC+VuYXEdd/d2uAePNqmCRFrarWlhs2x5skorpjRq61eTd6aS/1RgTaPCEnh+iJS0emPD2oyOHMEnYDj5aR6UZVJPhgGRe7WjHtZd5F+4qxONa8kU65S/2QZu926T4g3ChvS1GSMNoqgS+z9vBZaHAs3EwYrSFxvTvwVtil2dIpfWROmkEzXOcumWITZglaEpQbt+c4sM4svMrza/niBhR2/sqNkUOF3ugRyr6brgyz47AtEE5xL6uO73m6XlfJ+1exuDpMpAL92Lhqy5fYyZ+DZ8citB/MnVyE95BIfz4x+ovJQRHPaQyqXyfKQ==; s=purelymail2; d=federated.id; v=1; bh=i91j2NXwTsrlSEIfJDfuwTH+QfviRhHEAaG0FErAt5A=; h=Received:From:To; DKIM-Signature: a=rsa-sha256; b=I9+8WXVlxJB/q5wQDlafPNdr8qFLkARimtkA7AXnAk4cwx6zdL92MUnBI6+yhIeIh15PAHmG1r6W0ciUwcf3WFhmKbbG6W+cgyYR8y90yCNpWa7ltwAyL87BS8Xc0hp9m0qV9jk9tWYAzjeSgcF5cedk/lBqaYOMFD/LB4tOr+uTmt0n8HGZub0jkjI9V+TDT0JBm7qcQOeC6l/uPiAgsZQSr34PDcHUmwpbqEBHiioLsuPyM6PKr8wcoLrCnNzW/O0xC7SfwVw0H3wkaF76L1x6PdkPMTvPnEBLo0wfu4fmGGlHfE7mYp0Tbej40bwn66oxAe/CnHqhKw8tN0R24w==; s=purelymail2; d=purelymail.com; v=1; bh=i91j2NXwTsrlSEIfJDfuwTH+QfviRhHEAaG0FErAt5A=; h=Feedback-ID:Received:From:To; Feedback-ID: 58:13:null:purelymail X-Pm-Original-To: ~mariusor/activitypub-go@lists.sr.ht Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -32259127; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 22 Jul 2022 08:15:35 +0000 (UTC) Date: Fri, 22 Jul 2022 10:15:21 +0200 From: Marius Orcsik To: Anthony Wang Cc: "~mariusor/activitypub-go@lists.sr.ht" <~mariusor/activitypub-go@lists.sr.ht> Subject: Re: GetID() vs GetLink() Message-ID: <20220722081521.64xvuvmqiaveubhk@tp> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="utgdf2ujgp74mnrg" Content-Disposition: inline In-Reply-To: --utgdf2ujgp74mnrg Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 22-07-21 15:45:06, Anthony Wang wrote: > Hello Marius, >=20 > It appears that GetID() and GetLink() do something very similar. Is there= a difference between the two functions, and when should I use one instead = of the other? >=20 Hey Anthony, They are similar, and it's possible that in the long run GetID() will be dropped (at least from the Item interface). They reason why they both exist is because I wanted an interface that can be satisfied by both a "Link" object (which doesn't have an ID, because it represents a "link" to a resource outside the confines of an ActivityPub context) and an "Object" (which conforms to the addressing rules of ActivityPub, where the object can be uniquely dereferenced at the IRI of its ID). In the ActivityStreams vocabulary documentation[1] this difference is detailed a little (but not enough in my opinion). As such for types that are based on an ActivityPub object, the two methods return the same thing. For Link based objects (Mention is the only one that I saw in use so far), GetID() doesn't exist. I hope it clarifies things a little. /Marius [1] https://www.w3.org/TR/activitystreams-vocabulary/#object-types --utgdf2ujgp74mnrg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE4JZNDkIjOMGxS4AJNdhyBCWJDvcFAmLaXJUACgkQNdhyBCWJ DvdJuRAAqis3M0iUxWLLsUNI/TlBl1Ei6lXAt3mbrz9QvoUQSpGLwUIRC3tJJ6wY 640MYmcoc8jYnJ+Ki4sr778f5u2dTiTY04rhhlR33cyk6uosFu+wRaHymoJTbFwu kpsHfVyKvaYHcdsEz11cksAZhdEF8PIUdQQport6MwsjH5tGJVTlh3W1To3GEk7Q HUkVKwbHAjdEJo5l60l6e4wN1bEPsLnP1G4HlFF19yqAFgCreSB1Tlc3ZJ4Y5Rkf cJ/n5DLsr6jJCrjVgwpJ3dF/lUU6bGUd4D85pc91zbSPDr7jqx/CpNtdKmYXLSnG wUw1hfBgwAX556/7e4ADCgpBY80cMQUg/WcPGmSK3HspXM+dDiBAOSHLlp5kN7wr e99dEJt1ydfcl2M/jtdSlSIR4FIRfhaIPOj0pa85YQcGOVSyvUbY5siKgCk0nTOb mwvn/cSt2LA8vwZhDFiuibIX4wXpZTnjsBcL7DB8EWVe+NxqttWHWsoeDJwfFQTD 7JVJtAhklK/oV50y109m5eeLpDHf5ptnPnbJ3d02oo1MKS3tStg9GP4GvvErCoWh rgOb7SzFzWS5sncyXoEcA8+0AYWaV0esxNruUtveNz/vsDRAkUDxavbRWzR+zN/+ jLFzmI9SC/3rLvUbDZDCu0ctnJZbvGCE6TbI9JSjkoBKigAx3cM= =G8Ua -----END PGP SIGNATURE----- --utgdf2ujgp74mnrg--