Giter Site home page Giter Site logo

Implement Federation about go-misskey HOT 4 CLOSED

yitsushi avatar yitsushi commented on June 20, 2024
Implement Federation

from go-misskey.

Comments (4)

Skarlso avatar Skarlso commented on June 20, 2024 1

I'll take this :)

from go-misskey.

yitsushi avatar yitsushi commented on June 20, 2024 1

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

from go-misskey.

yitsushi avatar yitsushi commented on June 20, 2024

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.

yitsushi avatar yitsushi commented on June 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.