aop:Go 的 AOP 库

时间:2021-06-21 08:41:52
【文件属性】:
文件名称:aop:Go 的 AOP 库
文件大小:10KB
文件格式:ZIP
更新时间:2021-06-21 08:41:52
Go 奥普 AOP 处理 GO 源文件寻找特定的函数修饰注释,这些注释指示它通过调用 OnEntry 和 OnReturn 来包装这些函数 ##例子 假设 src.go 包含以下 Add 函数 // OnEntry: LogEnter // OnEntry: GetFromCache // OnReturn: LogReturn // OnReturn: StoreInCache func Add ( a , b int ) int { return a + b } Add 函数用 OnEntry 和 OnReturn 修饰,每个修饰指定它希望调用的函数,对于上面的例子 LogEnter 和 GetFromCache 将在每次调用 Add 时立即调用(按此顺序),一旦 Add 函数返回LogReturn 和 StoreInCache 都被调用(按照指定的顺序)。 装饰函数具有
【文件预览】:
aop-master
----test-cases()
--------primitive-entry.go(240B)
--------pointer-array.go(285B)
--------array-output.go(1KB)
--------pointer.go(274B)
--------array.go(951B)
--------primitive-both.go(301B)
--------no-directives.go(225B)
--------primitive-return.go(243B)
----LICENSE(1KB)
----README.md(2KB)
----aop_test.go(3KB)
----.gitignore(266B)
----aop.go(11KB)

网友评论