Documentation ¶
Index ¶
Constants ¶
View Source
const ( // COMMENT_PATH_PACKAGE package comment COMMENT_PATH_PACKAGE = 2 // COMMENT_PATH_MESSAGE message comment COMMENT_PATH_MESSAGE = 4 // COMMENT_PATH_ENUM enum comment COMMENT_PATH_ENUM = 5 // COMMENT_PATH_SERVICE service comment COMMENT_PATH_SERVICE = 6 // COMMENT_PATH_EXTENSION extension comment COMMENT_PATH_EXTENSION = 7 // COMMENT_PATH_SYNTAX syntax comment COMMENT_PATH_SYNTAX = 12 // COMMENT_PATH_MESSAGE_FIELD message.field COMMENT_PATH_MESSAGE_FIELD = 2 // COMMENT_PATH_MESSAGE_MESSAGE message.nested COMMENT_PATH_MESSAGE_MESSAGE = 3 // COMMENT_PATH_MESSAGE_ENUM message.enum COMMENT_PATH_MESSAGE_ENUM = 4 // COMMENT_PATH_MESSAGE_EXTENSION message.ectension COMMENT_PATH_MESSAGE_EXTENSION = 6 // COMMENT_PATH_ENUM_VALUE enum value COMMENT_PATH_ENUM_VALUE = 2 // COMMENT_PATH_SERVICE_METHOD service method COMMENT_PATH_SERVICE_METHOD = 2 )
comment path
View Source
const ( JSON_LABEL_OPTIONAL = "可选" JSON_LABEL_REQUIRED = "必须" JSON_LABEL_REPEATED = "重复" )
json 字段标签
View Source
const ( JSON_TPYE_NUMBER = `Number` JSON_TYPE_STRING = `String` JSON_TYPE_BOOLEAN = `Boolean` JSON_TYPE_OBJECT = `Object` )
json 字段类型
View Source
const ContentTypeJson = "application/json"
Variables ¶
This section is empty.
Functions ¶
func IsEntry ¶
func IsEntry(mf *MessageField) bool
IsEntry 是否为 proto 自动创建的 entry message. 例:map<string, string>
Types ¶
type Message ¶
type Message struct { Name string Description string Fields []*MessageField }
type MessageField ¶
type MessageField struct { // MessageName Message.Name MessageName string // Description field description Description string ProtoName string // proto field name ProtoLaber descriptorpb.FieldDescriptorProto_Label // proto 标签 ProtoType descriptorpb.FieldDescriptorProto_Type // 隐式类型 ProtoTypeName string // 显示类型 ProtoFullName string // 包名.结构名 ProtoPackagePath string // 包路径 ProtoNumber int32 // 排序 JsonName string // json field name JsonLabel string // json 标签 JsonType string // json 类型 JsonDefaultValue interface{} // json 数据默认值 }
type Package ¶
type Package struct { // Name Package.Name Name string // Version version Version string // Prefix uri prefix Prefix string // Services Service list Services []*Service // Enums Enum list Enums []*Enum // EnumDic Enum map EnumDic map[string]*Enum // Messages Message list Messages []*Message // MessageDic Message map MessageDic map[string]*Message // contains filtered or unexported fields }
type Service ¶
type Service struct { Name string Description string // Methods rpc list Methods []*ServiceMethod }
Click to show internal directories.
Click to hide internal directories.