Coder Social home page Coder Social logo

enrysrv's Introduction

Enry Server

Enry Server run as a gRPC service which expose GetLanguage to detect the programming language a file is written in.

How to install

  • To generate the vendor folder use glide install or glide up if you want to update the dependencies.
  • To regenerate .proto files, execute go generate
  • To build a binary make build. It generates ./bin/enrysrv

Usage

enrysrv can be launched as server or client. Client can choose if send the file content to the server.

$ ./bin/enrysrv server
...
INFO[0000] starting gRPC server
INFO[0009] Incoming request: OK 320.918µs --- filename: "foo.py", language: "Python", strategy: EXTENSION
INFO[0014] Incoming request: NEED CONTENT 210.074µs --- filename: "foo", language: "", strategy:
INFO[0029] Incoming request: IGNORED 142.816µs --- filename: "bar.json", language: "", strategy:
INFO[0056] Incoming request: OK 174.009µs --- filename: "foo", language: "Python", strategy: SHEBANG
...
$ ./bin/enrysrv client -f foo.py
...
INFO[0000] sending request
INFO[0000] detected language: Python
...

For the client -f flag is mandatory. If the server can't detect the language only with the file name, it replies with a need content message:

$ ./bin/enrysrv client -f foo
...
INFO[0000] sending request
WARN[0000] need content file to detect language
...

To send the file content to the server, you must add -c flag when you run the client:

$ ./bin/enrysrv client -c -f foo
...
INFO[0000] sending request
INFO[0000] detected language: Python
...

If enrysrv detect the file as a vendor/dotfile/configuration/documentation file, it will ingore that file:

$ ./bin/enrysrv client -f bar.json
...
INFO[0000] sending request
WARN[0000] ingored case, file is Vendor/DotFile/Documentation/Configuration
...

To launch a http server for profiling, add --profiler flag to the server:

$ ./bin/enrysrv server --profiler
...
INFO[0000] starting gRPC server
DEBU[0000] Started CPU & Heap profiler at "localhost:6073"
...

enrysrv's People

Contributors

bzz avatar mcarmonaa avatar newsiberian avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.