Comments (4)
I'll take this :)
from go-misskey.
Cut off the ap
endpoint into its own issue: #44
from go-misskey.
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
.
from go-misskey.
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.
from go-misskey.
Related Issues (20)
- Feature request: Retrieve user from token HOT 1
- Implement Admin/Moderation HOT 1
- Implement Admin/Instance HOT 2
- Implement Admin/Logs HOT 1
- Implement Admin/User HOT 1
- Implement Admin/Accounts HOT 1
- Implement Admin/Announcements HOT 1
- Implement Admin/Drive HOT 1
- Implement Admin/Emoji HOT 1
- Implement Admin/Federation HOT 1
- Implement Admin/Moderators HOT 1
- Implement Admin/Promo HOT 2
- Implement Admin/Queue HOT 1
- Implement Admin/Relays
- Implement Channels
- Proofread CONTRIBUTING.md
- Parse Data field in admin/queue/jobs response
- files.CreateFromURL() causes a crash in the client library. HOT 2
- Some of the request struct does not respect optional fields
- Emoji API is Compliant with Old Specification
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-misskey.