0.0.2 • Published 6 years ago

gerrit v0.0.2

Weekly downloads
6
License
-
Repository
github
Last release
6 years ago

gerrit

Gerrit API based on offical REST API

If links in this document not avaiable, please access [README on GitHub](./README.md) directly.

Description

Gerrit API based on official REST API.

Table of Contents

Links

Get Started

Class

const Rest = require('gerrit');
const apiconn = {
    username: 'http-username',
    password: 'http-password',
    endpoint: 'http://gerrit.example.com',
}

const rest = new Rest(apiconn);
rest.whoami().then(data => {
    // ...
}).catch(ex => {
    // ...
});

Standalone Function

const whoami = require('gerrit/whoami');
const apiconn = {
    username: 'http-username',
    password: 'http-password',
    endpoint: 'http://gerrit.example.com',
};

whoami(apiconn).then(data => {
    // ...
}).catch(ex => {
    // ...
});

API

  • Class Rest({ string username, string password, string endpoint })
  • Promise(Object) \<rest>.whoami()
  • Promise(Object) \<rest>.getProject({ string name })

All methods are asynchronous and will return instances of Promise. Hereafter, response means what to be obtained in .then((response) => { /* ... */ }).

All methods may be required and invoked by itself as what we see in Get Started, Standalone Function.

Examples

Before execute the examples, please replace the conn parameters according to your own account.