Giter VIP home page Giter VIP logo

tenpo-history-api's Introduction

History-API

Microservice implemented in Golang that stores history information into postgres DB.

Table

   Column   |           Type           | Collation | Nullable |      Default
------------+--------------------------+-----------+----------+-------------------
 id         | uuid                     |           | not null | gen_random_uuid()
 user_id    | character varying(255)   |           | not null |
 latitude   | character varying(255)   |           | not null |
 longitude  | character varying(255)   |           | not null |
 created_at | timestamp with time zone |           |          | now()
 updated_at | timestamp with time zone |           |          | now()
 deleted_at | timestamp with time zone |           |          |
Indexes:
    "history_pkey" PRIMARY KEY, btree (id)
Triggers:
    update_history_update_at BEFORE UPDATE ON history FOR EACH ROW EXECUTE PROCEDURE update_updated_at_column()

GRPC Service

service HistoryService {
  rpc ListHistoryByUserId(HistoryListByUserIdRequest) returns (HistoryListByUserIdResponse) {}
}

message History {
  string id = 1;
  string user_id = 2;
  string latitude = 3;
  string longitude = 4;

  int64 created_at = 5;
	int64 updated_at = 6;
}

message HistoryListByUserIdRequest {
  string user_id = 1;
}

message HistoryListByUserIdResponse {
  repeated History data = 1;
  Meta meta = 2;
  Error error = 3;
}

Commands (Development)

make build: build user service for osx.

make linux: build user service for linux os.

make docker: build docker.

docker run -it -p 5020:5020 tenpo-history-api: run docker.

PORT=<port> POSTGRES_DSN=<postgres_dsn> NATS_HOST=<nats_host> NATS_PORT=<nats_port> ./tenpo-history-api: run tenpo history service.

tenpo-history-api's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.