go backend

This commit is contained in:
Iris Lightshard 2024-05-09 22:14:40 -06:00
parent 1c1346e7cd
commit fc4dca167b
Signed by: Iris Lightshard
GPG key ID: 688407174966CAF3
5 changed files with 59 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
node_modules/ node_modules/
dist/*.js dist/*.js
src/ src/
underbbs

15
adapter/adapter.go Normal file
View 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
View file

@ -0,0 +1,3 @@
module forge.lightcrystal.systems/lightcrystal/underbbs
go 1.22.0

35
models/msg.go Normal file
View 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
View file

@ -0,0 +1,5 @@
package main
func main() {
return
}