GramCore/gram_core
xtaodada 1fe8a5efee
separate core code
Co-authored-by: 洛水居室 <luoshuijs@outlook.com>
Co-authored-by: Karako <karakohear@gmail.com>
Co-authored-by: LittleMengBot <79637933+LittleMengBot@users.noreply.github.com>
Co-authored-by: Nahida <NaHCOx@icloud.com>
Co-authored-by: SiHuan <sihuan@sakuya.love>
Co-authored-by: Chuangbo Li <im@chuangbo.li>
Co-authored-by: zhxy-CN <admin@owo.cab>
Co-authored-by: =?UTF-8?q?=E8=89=BE=E8=BF=AA?= <62269186+AnotiaWang@users.noreply.github.com>
2023-07-31 22:10:37 +08:00
..
builtins separate core code 2023-07-31 22:10:37 +08:00
dependence separate core code 2023-07-31 22:10:37 +08:00
handler separate core code 2023-07-31 22:10:37 +08:00
override separate core code 2023-07-31 22:10:37 +08:00
plugin separate core code 2023-07-31 22:10:37 +08:00
services separate core code 2023-07-31 22:10:37 +08:00
sqlmodel separate core code 2023-07-31 22:10:37 +08:00
__init__.py separate core code 2023-07-31 22:10:37 +08:00
application.py separate core code 2023-07-31 22:10:37 +08:00
base_service.py separate core code 2023-07-31 22:10:37 +08:00
basemodel.py separate core code 2023-07-31 22:10:37 +08:00
config.py separate core code 2023-07-31 22:10:37 +08:00
error.py separate core code 2023-07-31 22:10:37 +08:00
manager.py separate core code 2023-07-31 22:10:37 +08:00
ratelimiter.py separate core code 2023-07-31 22:10:37 +08:00
README.md separate core code 2023-07-31 22:10:37 +08:00
version.py separate core code 2023-07-31 22:10:37 +08:00

core 目录说明

关于 Service

服务 Service 需定义在 services 文件夹下, 并继承 core.service.Service

每个 Service 都应包含 startstop 方法, 且这两个方法都为异步方法

from core.service import Service


class TestService(Service):
    def __init__(self):
        """do something"""

    async def start(self, *args, **kwargs):
        """do something"""

    async def stop(self, *args, **kwargs):
        """do something"""