@timelab/user-service
User service
Last updated 2 years ago by mxmxmx .
ISC · Original npm · Tarball · package.json
$ cnpm install @timelab/user-service 
SYNC missed versions from official npm registry.

gRPC user-service

A simple gRPC user-service.

VERSIONS

Installation

$ npm install

Tested with

  • cassandra v3.0.10
  • node v9.2.0
  • npm v5.5.1

ENV

$ export CASSANDRA_HOSTS="cs01"
$ export CASSANDRA_KEYSPACE="timelab"
$ export GRPC_PORT="55003"

start

$ npm start

test

$ npm test

Definition

See user-service.proto for user-service definition.

User object example

Example GetUserIdByEmailRequest proto.

message GetUserIdByEmailRequest {
  string email = 1;
}

message GetUserIdByEmailResponse {
  timelab.model.common.Error error = 1;
  string id = 2;
  bool validAccount = 3;
}

Methods

getUserSettings

Get settings.

client.getUserSettings({
  email: 'tristan@timelab.io',
  field?: 'currency' // optional
});

setUserSettings

Set the user settings.

client.setUserSettings({
  id: 'a8ebc1de-0320-11e7-93ae-92361f002671',
  email: 'tristan@timelab.io'
  settings: {
    timezone: 'America/New_York',
    currency: 'USD'
  }
});

getUserIdByEmail

Get user id by email.

client.getUserIdByEmail({ email: 'tristan@timelab.io' });

getEmailByUserId.

Get email by user id.

client.getEmailByUserId({ id: 'a8ebc1de-0320-11e7-93ae-92361f002671' });

TODO

  • Add tests.
  • Improve documentation.

Current Tags

  • 3.0.26                                ...           latest (2 years ago)

17 Versions

  • 3.0.26                                ...           2 years ago
  • 3.0.25                                ...           2 years ago
  • 3.0.24                                ...           2 years ago
  • 3.0.23                                ...           2 years ago
  • 3.0.17                                ...           2 years ago
  • 3.0.12                                ...           2 years ago
  • 3.0.8                                ...           2 years ago
  • 3.0.6                                ...           2 years ago
  • 3.0.5                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 5
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |