Skip to content
/ Mirana Public

common components for webServer based on OpenResty. (Mirana was one of my favorite heroes in dota)

License

Notifications You must be signed in to change notification settings

tweyseo/Mirana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

common components

Overview

I use these components in my APIServer, two HttpServers and one TcpServer in a production environment, and of course all these servers are based on OpenResty or lor.

In order to reduce the duplication of work and facilitate the management of code, i integrated the common components in a single git repository which servers as a git submodule for all the servers mentioned above.

Because these components were coupled with my business layer code, so i had to decouple them and retest the decoupled components, and those tests were certainly not as good as that the online product went through, so welcome to report me the issues and i will solve them as soon as possible.

There are glance of these common components:

  • app: more minimalist web framework that refer to lor.
  • flowCtrl: control the workflow of your code (parallel, parallelRace, parallelPro and so on).
  • log: unify and standardize the log system.
  • net: wrap a simple network communication (TCP, HTTP and so on).
  • scheduler: sidecar like, expected to be the unified scheduling layer for some common components (net, storage and so on).
  • storage: wrap a simple storage (redis, rediscluster and so on).
  • toolkit: common utils (auto require, dump table, json encode/decode an so on).
  • wrapper: wrapper for advanced features (tracer and so on).

It's recommended to define your own public component directory structure like other components here (where both the scheduler and the toolkit are special).

Examples

A simple APIServer was served as an APIServer demo.

A simple TCPServer was served as a TCPServer demo.

TODO

  1. more common components will be implemented later (app was in the plan).
  2. performance optimization: follow performance guide and avoid NYI.

License

MIT

About

common components for webServer based on OpenResty. (Mirana was one of my favorite heroes in dota)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages