microservice-go

command module
v0.0.0-...-d78a86b Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: BSD-3-Clause Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Microservices for web chat and event invites

This project uses a GraphQL to handle web chats and event CURD

Model
  • User
  • Event
Seeder

object factory manufactures model objects

Graphql

type user{
    "name": str, 
    "password": str,
    "phone": str, required
    "email": str, 
    "emailConfirmed": bool, 
    "token": str,
    "createdAt": timestamp,
    "updatedAt": timestamp,
    "deletedAt": timestamp,
}
type events{
    "name": str, required
    "isVirtual": bool, required
    "isPrivate": bool, required
    "size": int, required
    "owner": user_id, required
    "guests":[
      {
      "user_id": object_id, 
      "phone": str,
      "confirmed": nil},
      ], required
    "intro": str,
    "createdAt": timestamp,
    "updatedAt": timestamp,
    "deletedAt": timestamp,
    "startAt": timestamp, required
    "endAt": timestamp, required
    "location":[
      "zoom":{
        "id":str,
        "password":str},
      "address":{
          "street":str,
          "city":str,
          "state":str}], required
    "chats":[
      {
        "user_id": object_id,
        "name": str,
        "message": str},]
}

Microservices

Microservices use RabbitMQ for internal communication.

  • GraphQL for external communication
  • Restful API for internal communication
Event Service
API

authenticated post

mutate event{}

response

{
  "data":{
    "event":{
      "_id": object_id,
    }
  }
}
Test
  • service runnable
  • service stoppable
  • read events
  • create event
  • update event
  • delete event
User Service
API
tests
  • login to get token
  • logout to delete token
  • use token to get protected resources
  • use token to push protected resources
  • use token to delete protected resources
Invite Service
Chat Service
API

authenticated post

mutate events(id){
  "chats": push
      { 
      "user_id": object_id,
      "name": str,
      "message": str,
      }
}

response

{
  "data":{
    "event":{
      "_id": object_id,
      "chats":[...]
    }
  }
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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