go backend
This commit is contained in:
parent
1c1346e7cd
commit
fc4dca167b
5 changed files with 59 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
dist/*.js
|
dist/*.js
|
||||||
src/
|
src/
|
||||||
|
underbbs
|
15
adapter/adapter.go
Normal file
15
adapter/adapter.go
Normal file
|
@ -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
|
||||||
|
}
|
3
go.mod
Normal file
3
go.mod
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
module forge.lightcrystal.systems/lightcrystal/underbbs
|
||||||
|
|
||||||
|
go 1.22.0
|
35
models/msg.go
Normal file
35
models/msg.go
Normal file
|
@ -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
|
||||||
|
}
|
5
underbbs.go
Normal file
5
underbbs.go
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
return
|
||||||
|
}
|
Loading…
Reference in a new issue