module
Version:
v0.0.0-...-7644878
Opens a new window with list of versions in this module.
Published: Jul 12, 2022
License: Apache-2.0
Opens a new window with license information.
README
¶
IOC-golang 示例
1. 简介
AOP
Autowire
Config File
- activate_profile
- complex_example
- default_config_file
- mark_env_variable_in_config_file
- mark_nested_value_in_config_file
- set_config_file_search_path
- set_config_file_type
- set_config_name
Helloworld
展示了README 中给出的例子
Third Party
-
autowire
-
db
-
autowire_gorm_db:
展示了注入 GORM 客户端的例子
-
registry
-
state
2. 如何运行
2.1 通过命令行启动
-
git clone 本项目
-
命令行进入示例目录下: cd example/helloworld
-
从命令行启动: go run .
对于有依赖组件的例子,例如 autowire_redis_client ,可以通过命令行运行 go test
,基于 docker 启动组件。详情参阅测试文件代码。对于有依赖 server 的例子,例如 autowire_grpc_client ,需要先启动 server。
2.2 通过 Goland 启动
- git clone 本项目
- 修改需要启动的例子 main函数中的
config.WithSearchPath("../conf")
为ioc_golang.yaml 所在文件夹的绝对路径。或者基于项目根目录的相对路径,例如 config.WithSearchPath("./extension/third_party/state/redis/conf")
- 通过 Goland 启动 main 方法,运行或debug。
3. 更多
可以参考 基于 IOC-golang 的电商系统demo 查看分布式场景下的应用系统示例
Directories
¶
aop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
autowire
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
third_party
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.