Skip to main content

A async Domain-Drive-Desgin support API develop framework,一个异步的,支持领域驱动开发的应用程序接口开放框架。

Project description


# SynicDomain

A async Domain-Drive-Desgin support API develop framework

一个?异步的,支持领域驱动开发的应用程序接口开放框架。

------

## 安装与实例

本框架支持Python3.6及以上版本的,目前只支持git clone

~~~shell
git clone https://github.com/TaylorHere/SynicDomain.git
#?查看实例
cd SynicDomain
python3.6 main.py
~~~

------

## 简单实例

~~~python
from SynicDomain import SynicDomain, Handler, Middware, Async_Task, SQLalchemyView
#导入相关?模块

app = SynicDomain()
#初始化一个SynicDomain App

@app.url('/', ['after_handle', 'login', 'before_handle', 'create_log'])
#将下面的类与url '/' 进行绑定,并且当用户访问这个url的时候
#按照after_handle、login、before_handle、create_log这样的顺序
#启动自己或其他endpoint
@app.endpoint
#声明下面的类是一个endpoint,endpoint可以与url?进行绑定
class login(Handler):
#一个处理?登陆事务的类,其父类为?Handler
async def core(self, cross_line, request):
#一个异步方法叫做core,其参数cross_line是一个信息结构体
#参数request是当次访问的请求对象
name = request.header('name')
#获取head
cross_line.add_result(self, name)
#给结构体?添加一些信息
return str(cross_line)
#将结构体字符画并返回

if __name__ == '__main__':
app.run()
#启动服务
~~~


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for SynicDomain, version 0.0.6.1
Filename, size File type Python version Upload date Hashes
Filename, size SynicDomain-0.0.6.1.tar.gz (14.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page