Skip to main content

原型

Proto 是一种数据类型,被用于用于在 Port 中保存 .proto 定义。

💡 常见原语 Usage

例如,proto 属性类型可用于存储在 .proto 文件中定义的类型:

  • 微服务之间的信息;
  • 微服务应用程序接口;

应用程序接口定义

{
"myProtoProp": {
"title": "My Proto",
"icon": "My icon",
"description": "My proto property",
"type": "string",
"format": "proto"
}
}

Check out Port's API reference to learn more.

Terraform 定义

resource "port_blueprint" "myBlueprint" {
# ...blueprint properties
properties = {
string_props = {
"myProtoProp" = {
title = "My proto"
required = false
format = "proto"
}
}
}
}

Pulumi 的定义

"""A Python Pulumi program"""

import pulumi
from port_pulumi import Blueprint,BlueprintPropertiesArgs,BlueprintPropertyArgs

blueprint = Blueprint(
"myBlueprint",
identifier="myBlueprint",
title="My Blueprint",
properties=BlueprintPropertiesArgs(
string_props={
"myProtoProp": BlueprintPropertyArgs(
title="My proto",
required=False,
format="proto",
)
}
),
relations={}
)