~mariusor/activitypub-go

7 3

Re: [PATCH] Adding Repository MarshalJSON and UnmarshalJSON methods

Anthony Wang <ta180m@proton.me>
Details
Message ID
<6aivY9YmilsvQ6CauRoaXbvXX2bdZEXOEv-xnaTD0JLvodqKPZ2FMdQHmXYKmEOdzrPZU9Ipro5sOynfe-hJbi5f31MiqOV8EI4rDOw88wg=@proton.me>
DKIM signature
pass
Download raw message
I agree that exporting some of the writeJSON functions would be beneficial, since most of this patch seems to be duplicating work that's already in go-ap/activitypub.

Re: [PATCH] Adding Repository MarshalJSON and UnmarshalJSON methods

Anthony Wang <ta180m@proton.me>
Details
Message ID
<MHn5Y15b6hkt9N6kNeWA6xyZuxMHPOk4YodkELzXvIzJWv0MepU-QeGKksTMyjbQru8kWw4xt_9u9DAjwh6IxA470xZ0zbt_ek46vtfvhhs=@proton.me>
In-Reply-To
<6aivY9YmilsvQ6CauRoaXbvXX2bdZEXOEv-xnaTD0JLvodqKPZ2FMdQHmXYKmEOdzrPZU9Ipro5sOynfe-hJbi5f31MiqOV8EI4rDOw88wg=@proton.me> (view parent)
DKIM signature
pass
Download raw message
------- Original Message -------
On Thursday, June 16th, 2022 at 12:03, Anthony Wang <ta180m@proton.me> wrote:


> I agree that exporting some of the writeJSON functions would be beneficial, since most of this patch seems to be duplicating work that's already in go-ap/activitypub.


I wrote my own version of repository.go (https://gitea.com/Ta180m/gitea/src/commit/dbb1d5ba23e1fede7b505d0b1ee24bd4e9d64dd4/models/forgefed/repository.go) reusing various Write and Load functions from go-ap/activitypub, and it came out to be only 70 lines. I'd recommend exporting at least write, writeItemJSONProp, loadActor, and loadObject, which should be enough for implementing ForgeFed.

Re: [PATCH] Adding Repository MarshalJSON and UnmarshalJSON methods

Details
Message ID
<82f6d3ed-0338-520b-d3ba-058fa2912ba8@dachary.org>
In-Reply-To
<MHn5Y15b6hkt9N6kNeWA6xyZuxMHPOk4YodkELzXvIzJWv0MepU-QeGKksTMyjbQru8kWw4xt_9u9DAjwh6IxA470xZ0zbt_ek46vtfvhhs=@proton.me> (view parent)
DKIM signature
missing
Download raw message
Hi,

Side note, too early at this stage I realize but that crossed my mind :-) The forgefed specs at https://forgefed.org/modeling.html#repository have not yet been updated with the latest changes, which include `cloneUri` https://codeberg.org/ForgeFed/ForgeFed/src/branch/master/spec/modeling.md#repository

My 2cts

On 16/06/2022 23:40, Anthony Wang wrote:
> ------- Original Message -------
> On Thursday, June 16th, 2022 at 12:03, Anthony Wang <ta180m@proton.me> wrote:
> 
> 
>> I agree that exporting some of the writeJSON functions would be beneficial, since most of this patch seems to be duplicating work that's already in go-ap/activitypub.
> 
> 
> I wrote my own version of repository.go (https://gitea.com/Ta180m/gitea/src/commit/dbb1d5ba23e1fede7b505d0b1ee24bd4e9d64dd4/models/forgefed/repository.go) reusing various Write and Load functions from go-ap/activitypub, and it came out to be only 70 lines. I'd recommend exporting at least write, writeItemJSONProp, loadActor, and loadObject, which should be enough for implementing ForgeFed.

-- 
Loïc Dachary, Artisan Logiciel Libre

Re: [PATCH] Adding Repository MarshalJSON and UnmarshalJSON methods

Details
Message ID
<20220617083756.25g3eboxcwhem35a@tp>
In-Reply-To
<MHn5Y15b6hkt9N6kNeWA6xyZuxMHPOk4YodkELzXvIzJWv0MepU-QeGKksTMyjbQru8kWw4xt_9u9DAjwh6IxA470xZ0zbt_ek46vtfvhhs=@proton.me> (view parent)
DKIM signature
pass
Download raw message
On 22-06-16 21:40:02, Anthony Wang wrote:
> I wrote my own version of repository.go (https://gitea.com/Ta180m/gitea/src/commit/dbb1d5ba23e1fede7b505d0b1ee24bd4e9d64dd4/models/forgefed/repository.go) reusing various Write and Load functions from go-ap/activitypub, and it came out to be only 70 lines. I'd recommend exporting at least write, writeItemJSONProp, loadActor, and loadObject, which should be enough for implementing ForgeFed.

Thank you Anthony,

This is great feedback, I added a ticket for this[1] but the end result
might have a different shape than you're suggesting.

/Marius

[1] https://todo.sr.ht/~mariusor/go-activitypub/248

Re: [PATCH] Adding Repository MarshalJSON and UnmarshalJSON methods

Anthony Wang <ta180m@proton.me>
Details
Message ID
<KUEX2vZKC2mKeQVlDLqCscsZ8I7BH_vvq4DWCG746zuPMu2eNH6qXb4H9_UfAMfjGb5cT08OcalF7YCo1O5ZDJ2G-9PR7p36kQSdX_FmF88=@proton.me>
In-Reply-To
<20220617083756.25g3eboxcwhem35a@tp> (view parent)
DKIM signature
pass
Download raw message
> On 22-06-16 21:40:02, Anthony Wang wrote:
> 

> > I wrote my own version of repository.go (https://gitea.com/Ta180m/gitea/src/commit/dbb1d5ba23e1fede7b505d0b1ee24bd4e9d64dd4/models/forgefed/repository.go) reusing various Write and Load functions from go-ap/activitypub, and it came out to be only 70 lines. I'd recommend exporting at least write, writeItemJSONProp, loadActor, and loadObject, which should be enough for implementing ForgeFed.
> 

> 

> Thank you Anthony,
> 

> This is great feedback, I added a ticket for this[1] but the end result
> might have a different shape than you're suggesting.
> 

> /Marius
> 

> [1] https://todo.sr.ht/~mariusor/go-activitypub/248

Hello Marius,

I finished implementing most of the ForgeFed types and I ended up using the following go-ap functions: WriteItemJSONProp, Write, WriteTimeJSONProp, WriteItemCollectionJSONProp, Write BoolJSONProp, JSONGetItem, JSONGetTime, JSONGetItems, JSONGetBoolean, LoadActor, and LoadObject. I needed a few more functions exported than what I initially stated, since the JSON properties that ForgeFed adds have several other types, like times, booleans, and collections.

-Anthony Wang

Re: [PATCH] Adding Repository MarshalJSON and UnmarshalJSON methods

Details
Message ID
<20220711145120.e24zoechpmddvky6@tp>
In-Reply-To
<KUEX2vZKC2mKeQVlDLqCscsZ8I7BH_vvq4DWCG746zuPMu2eNH6qXb4H9_UfAMfjGb5cT08OcalF7YCo1O5ZDJ2G-9PR7p36kQSdX_FmF88=@proton.me> (view parent)
DKIM signature
pass
Download raw message
On 22-07-10 16:18:28, Anthony Wang wrote:
> 
> I finished implementing most of the ForgeFed types and I ended up using the following go-ap functions: WriteItemJSONProp, Write, WriteTimeJSONProp, WriteItemCollectionJSONProp, Write BoolJSONProp, JSONGetItem, JSONGetTime, JSONGetItems, JSONGetBoolean, LoadActor, and LoadObject. I needed a few more functions exported than what I initially stated, since the JSON properties that ForgeFed adds have several other types, like times, booleans, and collections.
> 

Hey Anthony, good to hear back from you.

If you feel like it, could you please send a patch with the changes? In
the long run I'm not sure I want to have all this functionality in the
same package with the vocabulary, but for the moment it will probably be
helpful to have everything there.

Let me know.

/Marius

Re: [PATCH] Adding Repository MarshalJSON and UnmarshalJSON methods

Anthony Wang <ta180m@proton.me>
Details
Message ID
<SwcuUFVSmIpgfS79R4egMY0hUuVYe_I2KoTFnBOal3oTykhgpBtrfKxhXXP0zynVtdevyv0jkl49EGIzd-0W09ybxhzXN974iJOInJvLv04=@proton.me>
In-Reply-To
<20220711145120.e24zoechpmddvky6@tp> (view parent)
DKIM signature
pass
Download raw message
On Monday, July 11th, 2022 at 09:51, Marius Orcsik <marius@federated.id> wrote:

> If you feel like it, could you please send a patch with the changes? In
> the long run I'm not sure I want to have all this functionality in the
> same package with the vocabulary, but for the moment it will probably be
> helpful to have everything there.

Hello Marius,

I'm currently using a fork of the module with all the Write and Load functions exported: https://gitea.com/Ta180m/activitypub/commit/d7fe75e8a60cea702b7665512358d397f49ed28a

This probably exports too many functions than what would be ideal, but for now I've switched my Gitea code to depend on this custom fork of the activitypub module instead of the upstream go-ap/activitypub module.

-Anthony

Re: [PATCH] Adding Repository MarshalJSON and UnmarshalJSON methods

Details
Message ID
<20220712095755.t26iolo53arddw7t@tp>
In-Reply-To
<SwcuUFVSmIpgfS79R4egMY0hUuVYe_I2KoTFnBOal3oTykhgpBtrfKxhXXP0zynVtdevyv0jkl49EGIzd-0W09ybxhzXN974iJOInJvLv04=@proton.me> (view parent)
DKIM signature
pass
Download raw message
On 22-07-11 18:44:42, Anthony Wang wrote:
> On Monday, July 11th, 2022 at 09:51, Marius Orcsik <marius@federated.id> wrote:
> I'm currently using a fork of the module with all the Write and Load functions exported: https://gitea.com/Ta180m/activitypub/commit/d7fe75e8a60cea702b7665512358d397f49ed28a
> 
OK, thank you.

I'll try to have a look and get back to you if I can merge it.

/Marius
Reply to thread Export thread (mbox)