Golang Chat is modular chat based on Uncle Bob's Clean Architecture principle.
Focus on usecase. All dependency interface located in folder usercase/dependency. We can change dependency implementation (database, sms sender, token generator, etc) via ioc.
Using default implementation: No. You can use Go-Chat usecase, then implement dependency by Yours.
Copy config.go.example to config.go in folder configuration.
go build && ./go-chat
package main
import (
"log"
"yourpackage"
"github.com/ariefsam/go-chat/entity"
"github.com/ariefsam/go-chat/usecase"
)
func main() {
var u usecase.Usecase
// Your Implementation for Chat Repository
// Must implement usecase/dependency/ChatRepository interface
chat := yourpackage.Chat{}
u.ChatRepository = &chat
inputChat := entity.Chat{
SenderID: "xxx",
Timestamp: 34400,
ChatType: "group",
ReceiverID: "groupid",
Message: "Testing Message",
}
savedChat, err := u.AddChat(inputChat)
log.Println(savedChat,err)
}
Please join https://t.me/joinchat/I3ig_RhopGul_UKGjDhl8g