-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Migrate the main.go directory
- Loading branch information
Showing
30 changed files
with
1,310 additions
and
1,317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Koala Rule Engine Core | ||
* | ||
* @package: main | ||
* @desc: koala engine - Main router | ||
* | ||
* koala频率控制服务 (规则引擎) | ||
* 用途:是为了解决用户提交等相关频率控制的一个通用服务,主要是为了替换传统写死代码的频率控制模块以达到 高性能、灵活配置的要求。 | ||
* 方案:支持高度灵活的规则配置;并实现了规则配置的动态加载; 后端cache采用带连接池的redis。 | ||
* | ||
* @author: heiyeluren | ||
* @github: https://github.com/heiyeluren | ||
* @blog: https://blog.csdn.net/heiyeshuwu | ||
* | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/heiyeluren/koala/koala" | ||
) | ||
|
||
/** | ||
* koala服务进程的main函数 | ||
*/ | ||
func main() { | ||
// Start koala | ||
koala.Run() | ||
|
||
// 启动 rule统计协程 | ||
go koala.CounterAgent() | ||
|
||
// 启动 规则更新协程,定期检查 policy 更新 | ||
go koala.PolicyLoader() | ||
|
||
// 启动 http监听协程 | ||
go koala.FrontListen() | ||
|
||
// hold 住 main协程 | ||
select {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* | ||
*/ | ||
|
||
package main | ||
package koala | ||
|
||
import ( | ||
"errors" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.