Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tcurl

Package Overview
Dependencies
Maintainers
5
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tcurl

A command line utility to talk to a tchannel server

  • 4.12.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
67
increased by415.38%
Maintainers
5
Weekly downloads
 
Created
Source

tcurl

A command line utility to talk to a tchannel server

tcurl -p host:port <service> <endpoint> [options]

  Options:
    -2 [data] send an arg2 blob
    -3 [data] send an arg3 blob
    --shardKey send ringpop shardKey transport header
    --depth=n configure inspect printing depth
    -j print JSON
    -J [indent] print JSON with indentation
    -t [dir] directory containing Thrift files

Installation

npm install tcurl

Examples

Thrift

For the purposes of these examples, let's assume that you have a TChannel server listening on localhost:1234. The server registers handlers for the thrift interface saved as services/chamber.thrift and defined as:

struct EchoRequest {
  1: required string input;
}

service Chamber {
  string echo(
    1: required EchoRequest request;
  )
}

You could use TCurl to query this service by running:

tcurl -p localhost:1234 chamber Chamber::echo -t ./services -3 '{"request": {"input": "foo"}}'

localhost caveat

For TChannel and Hyperbahn to work together effectively, most tchannel services need to listen on the external IP of the host they are running on.

This means when you use 127.0.0.1 you cannot reach the service with tcurl as it's not listening on loopback.

To make supporting external IPs easier we've made localhost resolve to the external IP of the machine. This means if your listening on loopback you have to use 127.0.0.1 and not localhost

NPM scripts

  • npm run add-licence This will add the licence headers.
  • npm run cover This runs the tests with code coverage
  • npm run lint This will run the linter on your code
  • npm test This will run the tests.
  • npm run trace This will run your tests in tracing mode.
  • npm run travis This is run by travis.CI to run your tests
  • npm run view-cover This will show code coverage in a browser

Contributors

  • Raynos
  • ShanniLi

MIT Licenced

FAQs

Package last updated on 15 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc