Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Federation #4

Closed
5 tasks done
yitsushi opened this issue Oct 8, 2020 · 4 comments
Closed
5 tasks done

Implement Federation #4

yitsushi opened this issue Oct 8, 2020 · 4 comments
Labels
✨ Feature New feature request or enhancement suggestion ❤️ Good first issue Good for newcomers 🛠️ Service Service related issue
Milestone

Comments

@yitsushi
Copy link
Owner

yitsushi commented Oct 8, 2020

@yitsushi yitsushi added ❤️ Good first issue Good for newcomers ✨ Feature New feature request or enhancement suggestion labels Oct 14, 2020
@Skarlso
Copy link
Contributor

Skarlso commented Oct 19, 2020

I'll take this :)

This was referenced Oct 22, 2020
@yitsushi yitsushi added this to the v1.1 milestone Oct 25, 2020
@yitsushi yitsushi added the 🛠️ Service Service related issue label Oct 25, 2020
This was referenced Oct 26, 2020
@yitsushi
Copy link
Owner Author

The ap/show endpoint will be tricky. It does not have one response. The response is depending on the resource it was requested, the result type will be specified in the type field of the root object and the result will be in the object.

@yitsushi
Copy link
Owner Author

I added some response JSON files as a fixture: https://github.com/yitsushi/go-misskey/tree/main/services/federation/fixtures/ap-show

[discussion]
Maybe ap/show should live in its own service "client.Ap()" and all possible types will be added as a new function like client.Ap().ShowNote(string uri). It should have only one ShowRequest and a Show() function that returns with an ShowResponse and all other functions would just call that Show() function and typecast the Object property and return only with that property.

type ShowResponse struct {
  Type string `json:"type"`
  Object interface{} `json:"object"`
}

That way if someone wants to query an unimplemented resource or they want to use it as a detector "I got this URI, what is its type?", they can use Show() and use the type field to check what its Type, but if they know the resource type or they want a specific resource type like Note if it's not a Node they want an error, they can use the ShowNote() function.

@yitsushi
Copy link
Owner Author

Cut off the ap endpoint into its own issue: #44

@yitsushi yitsushi modified the milestones: v1.1, v1.0 Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature New feature request or enhancement suggestion ❤️ Good first issue Good for newcomers 🛠️ Service Service related issue
Projects
None yet
Development

No branches or pull requests

2 participants