go backend
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQT/foVVmI9pK13hPWFohAcXSWbK8wUCZj2fMAAKCRBohAcXSWbK 81yOAQCmvwRzo0wPBkxOH9K9l9mLnRstD02DDiAzMEBAdUWhGQD9GQDT+EkacaEJ G1LLkniwAVvITvpxHsJDiXuGfLQEuAE= =cUsK -----END PGP SIGNATURE-----
5 files changed,
59 insertions(+),
0 deletions(-)
A
adapter/adapter.go
@@ -0,0 +1,15 @@
+package adapter + +import ( + . "forge.lightcrystal.systems/lightcrystal/underbbs/models" +) + +type Adapter interface { + Init(map[string]string, chan Message) error + Subscribe(string) error + SendMessage(Message) error + Follow(Author) error + Unfollow(Author) error + GetFollowers() error + UpdateMetadata(interface{}) error +}
A
models/msg.go
@@ -0,0 +1,35 @@
+package models + +import ( + "time" +) + +type MessageFactory interface { + FromNostr(interface{}) Message + FromMasto(interface{}) Message +} + +type Message struct { + Author Author + Protocol string + Content string + Attachments []Attachment + ReplyTo Message + Replies []Message + Mentions []Author + Created time.Time + Aux *interface{} +} + +type Author struct { + Id string + Name string + ProfileData interface{} + Messages []Message +} + +type Attachment struct { + Src string + Data []uint8 + Desc string +}