Giter Site home page Giter Site logo

itsriyan / microservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from claygod/microservice

0.0 0.0 0.0 35 KB

This library provides a simple framework of microservice, which includes a configurator, a logger, metrics, and of course the handler

License: Other

Go 100.00%

microservice's Introduction

Microservice

API documentation Go Report Card

The framework for the creation of microservices, written in Golang. (note: http microservice)

Architecture microservice includes:

  • handle
  • tuner (configuration)
  • middleware-style tools (for demo)

Create a new Middleware

Use as a example tools/metric.go file.

Creating a new handler

To do this, you just need to create a new public method in the handler, which takes input http.ResponseWriter, http.Request. Look created to demonstrate the method HelloWorld.

Perfomance

For a general understanding of what is the speed of microservice using the proposed architecture will be high, and bring the benchmark results obtained by me on my computer:

  • BenchmarkMain-2 10000000 192 ns/op
  • BenchmarkMainParallel-2 10000000 104 ns/op

Tuner

The default configuration file:

  • config.toml

Specify in the command line another file:

  • yourservice -confile other.toml

To change the setting on the command line, you specify the section and parameter name (composed by a slash):

  • yourservice -Main/Port 85

Configuring priorities:

  • command line (highest priority)
  • environment
  • configuration file

Dependencies

Any of these libraries can be replaced or supplemented, in this case, they are likely designed to show which way to develop their own microservices. You might also be useful to connect logstash and influxdb.

Conclusion

Microservice Library does not claim the laurels of the only true solution, but on occasion, I hope, will help you create your own micro-architecture of the service, becoming the prototype for future applications.

Copyright © 2017-2019 Eduard Sesigin. All rights reserved. Contacts: [email protected]

microservice's People

Contributors

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