Giter Site home page Giter Site logo

gerrit-stream's Introduction

GerritStream

A minimal wrapper for getting information out of gerrit's stream-events SSH hook.

API

First, you'll need a GerritProcess to work with:

GerritProcess

constructor( host, [,port], [,gerritCommand] )

port defaults to gerrit's default (29418 ) if not provided.

gerritCommand defaults to stream-events if not provided.

var GerritProcess = require( 'gerrit-stream' ).GerritProcess
  , gerritProcess = new GerritProcess( host )

GerritStream

A GerritStream can have many "subscribers", or writable Streams listen to data passed into it from the GerritProcess. If you pass in a subscribing Stream, note you'll be getting the raw Buffer back from the process.

You'll need to pass gerritProcess.stdout to the GerritStream constructor. If you use stderror or stdin for some reason, just pass that in instead.

constructor( gerritProcess )

var gerritStream = new GerritStream( gerritProcess.stdout )

addSubscriber( stream )

Adds a subscriber stream to listen for data events on the GerritStream.

gerritStream.addSubscriberStream

removeSubscriber( stream )

Removes a subscriber Stream. Stops the GerritStream instance from calling write on the subscriber Stream.

Utility Functions

This library includes a few helper functions that generate JSONStreams.

var stream = require( 'gerrit-process' ).JSONStreams.eventName

Any of the JSONStreams sort based on the type key in the root of the JSON document. { "type": "changeset-restored" } maps to JSONStreams.changesetRestored

List of JSONStreams available on JSONStreams:

  • patchsetCreated
  • changeAbandoned
  • changeRestored
  • changeAbandoned
  • changeRestored
  • changeMerged
  • commentAdded
  • refUpdated

gerrit-stream's People

Contributors

fivetanley avatar

Stargazers

 avatar  avatar Jordan Crouse avatar Brett Nekolny avatar Paul Bourke avatar Shogo Iwano avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

squaad99 edcjrh

gerrit-stream's Issues

Project abandoned?

Hi,

Is this project active enough to contribute changes to?
Should pull requests be submitted for fixes, or is this project considered abandoned?

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.