【图形描述语言】draft

本系列介绍 文本转图片 工具,图形描述语言将图片描述为代码或者文本,有利于版本管理,很适合嵌入 LaTeX 或 Markdown 文档。用于网站时,还可以减轻图片存储压力,因为图片可以根据代码在使用时生成。本文是该系列第九篇,介绍 draft

概述

A commandline tool that generate High Level microservice & serverless Architecture diagrams using a declarative syntax defined in a YAML file.

A picture is worth a thousand words… and this is particularly true in regard to complex IT architectures.

draft

Draft 是一个命令行工具,能将 使用 YAML 描述的微服务架构转换成 Graphviz Dot 源码,然后用 dot 生成架构图。

语法介绍

Draft 架构图的基本单元叫做 组件(components),每个组件可以有以下属性:

Draft使用了一组独立于不同提供商(AWS、Microsoft Azure、GCP)的符号。

Client

Microservice

Gateway

Message Broker

Queue Service

Object Storage

Function

Database

draft Client组件
draft Client组件
draft Service组件
draft Service组件
draft Gateway组件
draft Gateway组件
draft Message Broker组件
draft Message Broker组件
draft Queue Service组件
draft Queue Service组件
draft Object Storage组件
draft Object Storage组件
draft Function组件
draft Function组件
draft Database组件
draft Database组件

连接关系

连接关系可以定义的属性:

componentId 可以显式定义,也可以自动生成,自动生成规则如下:

a kind of...will generate an id prefix with...examples
clientclcl1, cl2,...
servicemsms1, ms2,...
gatewaygtgt1, gt2,...
brokerbrbr1, br2,...
queueqsqs1, qs2,...
storagestst1, st2,...
functionfnfn1, fn2,...
databasedbdb1, db2,...
Autogenerated id

draft画廊

message bus pattern
message bus pattern
AWS Cognito Custom Authentication Flow
AWS Cognito Custom Authentication Flow
Upload file to S3 using Lambda for pre-signed URL
Upload file to S3 using Lambda for pre-signed URL

以上就是全部内容,欢迎到 文本转图片工具 试用。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注