go-chat

command module
v0.0.0-...-407fbd6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 3 Imported by: 0

README

Go-Chat

Golang Chat is modular chat based on Uncle Bob's Clean Architecture principle.

Clean Architecture

Focus on usecase. All dependency interface located in folder usercase/dependency. We can change dependency implementation (database, sms sender, token generator, etc) via ioc.

Is Go-Chat Production Ready?

Using default implementation: No. You can use Go-Chat usecase, then implement dependency by Yours.

Using Go-Chat with default Implementation

Copy config.go.example to config.go in folder configuration.

go build && ./go-chat

Using Go-Chat with custom Implementation

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)
}

Telegram Group

Please join https://t.me/joinchat/I3ig_RhopGul_UKGjDhl8g

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL