bbq

package
v0.0.0-...-d853fe5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContentType_name = map[int32]string{
		0: "Proto",
	}
	ContentType_value = map[string]int32{
		"Proto": 0,
	}
)

Enum value maps for ContentType.

View Source
var (
	CompressType_name = map[int32]string{
		0: "None",
		1: "Gzip",
	}
	CompressType_value = map[string]int32{
		"None": 0,
		"Gzip": 1,
	}
)

Enum value maps for CompressType.

View Source
var (
	RequestType_name = map[int32]string{
		0: "RequestRequest",
		1: "RequestRespone",
	}
	RequestType_value = map[string]int32{
		"RequestRequest": 0,
		"RequestRespone": 1,
	}
)

Enum value maps for RequestType.

View Source
var (
	CallType_name = map[int32]string{
		0: "Unary",
		1: "OneWay",
	}
	CallType_value = map[string]int32{
		"Unary":  0,
		"OneWay": 1,
	}
)

Enum value maps for CallType.

View Source
var (
	ServiceType_name = map[int32]string{
		0: "Entity",
		1: "Service",
	}
	ServiceType_value = map[string]int32{
		"Entity":  0,
		"Service": 1,
	}
)

Enum value maps for ServiceType.

View Source
var (
	MySQL_name = map[int32]string{
		0: "MYSQL_FIELD",
		1: "MYSQL_NONE",
		2: "MYSQL_PRIMARY_KEY",
		3: "MYSQL_UNIQUE",
		4: "MYSQL_INDEX",
	}
	MySQL_value = map[string]int32{
		"MYSQL_FIELD":       0,
		"MYSQL_NONE":        1,
		"MYSQL_PRIMARY_KEY": 2,
		"MYSQL_UNIQUE":      3,
		"MYSQL_INDEX":       4,
	}
)

Enum value maps for MySQL.

View Source
var (
	MONGO_name = map[int32]string{
		0: "MGO_FIELD",
		1: "MGO_NONE",
		2: "MGO_ID",
	}
	MONGO_value = map[string]int32{
		"MGO_FIELD": 0,
		"MGO_NONE":  1,
		"MGO_ID":    2,
	}
)

Enum value maps for MONGO.

View Source
var (
	// FooOptions foo_options = 1234;
	//
	// optional bbq.Field field = 1100;
	E_Field = &file_bbq_proto_extTypes[0]
)

Extension fields to descriptor.FieldOptions.

View Source
var (
	// optional bbq.ServiceType service_type = 50100;
	E_ServiceType = &file_bbq_proto_extTypes[1]
)

Extension fields to descriptor.ServiceOptions.

Functions

This section is empty.

Types

type CallType

type CallType int32
const (
	CallType_Unary  CallType = 0
	CallType_OneWay CallType = 1
)

func (CallType) Descriptor

func (CallType) Descriptor() protoreflect.EnumDescriptor

func (CallType) Enum

func (x CallType) Enum() *CallType

func (CallType) EnumDescriptor deprecated

func (CallType) EnumDescriptor() ([]byte, []int)

Deprecated: Use CallType.Descriptor instead.

func (CallType) Number

func (x CallType) Number() protoreflect.EnumNumber

func (CallType) String

func (x CallType) String() string

func (CallType) Type

type CompressType

type CompressType int32
const (
	CompressType_None CompressType = 0
	CompressType_Gzip CompressType = 1
)

func (CompressType) Descriptor

func (CompressType) Enum

func (x CompressType) Enum() *CompressType

func (CompressType) EnumDescriptor deprecated

func (CompressType) EnumDescriptor() ([]byte, []int)

Deprecated: Use CompressType.Descriptor instead.

func (CompressType) Number

func (CompressType) String

func (x CompressType) String() string

func (CompressType) Type

type ContentType

type ContentType int32
const (
	ContentType_Proto ContentType = 0
)

func (ContentType) Descriptor

func (ContentType) Enum

func (x ContentType) Enum() *ContentType

func (ContentType) EnumDescriptor deprecated

func (ContentType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ContentType.Descriptor instead.

func (ContentType) Number

func (x ContentType) Number() protoreflect.EnumNumber

func (ContentType) String

func (x ContentType) String() string

func (ContentType) Type

type Field

type Field struct {

	// 自定义tag,可以自己针对不同的tag实现不同的逻辑
	Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
	// mysql
	Mysql MySQL `protobuf:"varint,2,opt,name=mysql,proto3,enum=bbq.MySQL" json:"mysql,omitempty"`
	// mongo
	Mgo MONGO `protobuf:"varint,3,opt,name=mgo,proto3,enum=bbq.MONGO" json:"mgo,omitempty"`
	// contains filtered or unexported fields
}

func (*Field) Descriptor deprecated

func (*Field) Descriptor() ([]byte, []int)

Deprecated: Use Field.ProtoReflect.Descriptor instead.

func (*Field) GetMgo

func (x *Field) GetMgo() MONGO

func (*Field) GetMysql

func (x *Field) GetMysql() MySQL

func (*Field) GetTag

func (x *Field) GetTag() string

func (*Field) ProtoMessage

func (*Field) ProtoMessage()

func (*Field) ProtoReflect

func (x *Field) ProtoReflect() protoreflect.Message

func (*Field) Reset

func (x *Field) Reset()

func (*Field) String

func (x *Field) String() string
type Header struct {

	// 协议版本
	Version uint32 `protobuf:"varint,1,opt,name=Version,proto3" json:"Version,omitempty"`
	// 请求唯一id
	RequestId string `protobuf:"bytes,2,opt,name=RequestId,proto3" json:"RequestId,omitempty"`
	// 请求的超时时间,单位ms
	Timeout uint32 `protobuf:"varint,3,opt,name=Timeout,proto3" json:"Timeout,omitempty"`
	// 是请求包,还是返回包
	RequestType RequestType `protobuf:"varint,4,opt,name=RequestType,proto3,enum=bbq.RequestType" json:"RequestType,omitempty"`
	// sverice or entity
	ServiceType ServiceType `protobuf:"varint,5,opt,name=ServiceType,proto3,enum=bbq.ServiceType" json:"ServiceType,omitempty"`
	// Unary or OneWay, OneWay no response, just notify
	CallType CallType `protobuf:"varint,6,opt,name=CallType,proto3,enum=bbq.CallType" json:"CallType,omitempty"`
	// 调用的原EntityID
	SrcEntity uint64 `protobuf:"varint,7,opt,name=SrcEntity,proto3" json:"SrcEntity,omitempty"`
	// 调用的目的EntityID
	DstEntity uint64 `protobuf:"varint,8,opt,name=DstEntity,proto3" json:"DstEntity,omitempty"`
	// 规范格式: 类名,服务名
	Type string `protobuf:"bytes,9,opt,name=Type,proto3" json:"Type,omitempty"`
	// 规范格式: 接口名
	Method string `protobuf:"bytes,10,opt,name=Method,proto3" json:"Method,omitempty"`
	// 请求数据的序列化类型
	// 比如: proto/jce/json, 默认proto
	// 具体值与ContentEncodeType对应
	ContentType ContentType `protobuf:"varint,11,opt,name=ContentType,proto3,enum=bbq.ContentType" json:"ContentType,omitempty"`
	// 请求数据使用的压缩方式
	// 比如: gzip/snappy/..., 默认不使用
	// 具体值与CompressType对应
	CompressType CompressType `protobuf:"varint,12,opt,name=CompressType,proto3,enum=bbq.CompressType" json:"CompressType,omitempty"`
	// 是否检查包是否正确
	Flags uint32 `protobuf:"varint,13,opt,name=Flags,proto3" json:"Flags,omitempty"`
	// 附加信息
	TransInfo map[string][]byte `` /* 160-byte string literal not displayed */
	// 返回值
	ErrCode int32  `protobuf:"varint,15,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"`
	ErrMsg  string `protobuf:"bytes,16,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"`
	// contains filtered or unexported fields
}

请求协议头

func (*Header) Descriptor deprecated

func (*Header) Descriptor() ([]byte, []int)

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetCallType

func (x *Header) GetCallType() CallType

func (*Header) GetCompressType

func (x *Header) GetCompressType() CompressType

func (*Header) GetContentType

func (x *Header) GetContentType() ContentType

func (*Header) GetDstEntity

func (x *Header) GetDstEntity() uint64

func (*Header) GetErrCode

func (x *Header) GetErrCode() int32

func (*Header) GetErrMsg

func (x *Header) GetErrMsg() string

func (*Header) GetFlags

func (x *Header) GetFlags() uint32

func (*Header) GetMethod

func (x *Header) GetMethod() string

func (*Header) GetRequestId

func (x *Header) GetRequestId() string

func (*Header) GetRequestType

func (x *Header) GetRequestType() RequestType

func (*Header) GetServiceType

func (x *Header) GetServiceType() ServiceType

func (*Header) GetSrcEntity

func (x *Header) GetSrcEntity() uint64

func (*Header) GetTimeout

func (x *Header) GetTimeout() uint32

func (*Header) GetTransInfo

func (x *Header) GetTransInfo() map[string][]byte

func (*Header) GetType

func (x *Header) GetType() string

func (*Header) GetVersion

func (x *Header) GetVersion() uint32

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

func (x *Header) ProtoReflect() protoreflect.Message

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

type MONGO

type MONGO int32

mongodb

const (
	MONGO_MGO_FIELD MONGO = 0 // 普通db字段
	MONGO_MGO_NONE  MONGO = 1 // 非db字段,不持久化,其他类型都是db字段,持久化存储
	MONGO_MGO_ID    MONGO = 2 // 主键
)

func (MONGO) Descriptor

func (MONGO) Descriptor() protoreflect.EnumDescriptor

func (MONGO) Enum

func (x MONGO) Enum() *MONGO

func (MONGO) EnumDescriptor deprecated

func (MONGO) EnumDescriptor() ([]byte, []int)

Deprecated: Use MONGO.Descriptor instead.

func (MONGO) Number

func (x MONGO) Number() protoreflect.EnumNumber

func (MONGO) String

func (x MONGO) String() string

func (MONGO) Type

func (MONGO) Type() protoreflect.EnumType

type MySQL

type MySQL int32
const (
	MySQL_MYSQL_FIELD       MySQL = 0 // 普通db字段
	MySQL_MYSQL_NONE        MySQL = 1 // 非db字段,不持久化,其他类型都是db字段,持久化存储
	MySQL_MYSQL_PRIMARY_KEY MySQL = 2 // 主键
	MySQL_MYSQL_UNIQUE      MySQL = 3 // 唯一索引
	MySQL_MYSQL_INDEX       MySQL = 4 // 普通索引
)

func (MySQL) Descriptor

func (MySQL) Descriptor() protoreflect.EnumDescriptor

func (MySQL) Enum

func (x MySQL) Enum() *MySQL

func (MySQL) EnumDescriptor deprecated

func (MySQL) EnumDescriptor() ([]byte, []int)

Deprecated: Use MySQL.Descriptor instead.

func (MySQL) Number

func (x MySQL) Number() protoreflect.EnumNumber

func (MySQL) String

func (x MySQL) String() string

func (MySQL) Type

func (MySQL) Type() protoreflect.EnumType

type RequestType

type RequestType int32
const (
	RequestType_RequestRequest RequestType = 0
	RequestType_RequestRespone RequestType = 1
)

func (RequestType) Descriptor

func (RequestType) Enum

func (x RequestType) Enum() *RequestType

func (RequestType) EnumDescriptor deprecated

func (RequestType) EnumDescriptor() ([]byte, []int)

Deprecated: Use RequestType.Descriptor instead.

func (RequestType) Number

func (x RequestType) Number() protoreflect.EnumNumber

func (RequestType) String

func (x RequestType) String() string

func (RequestType) Type

type ServiceType

type ServiceType int32
const (
	// 请求entity,需要提供entity id, entity是有ID的service, entity可以创建很多
	ServiceType_Entity ServiceType = 0
	// 请求service,只需要提供完整接口名,service是单例entity,只能有一个
	ServiceType_Service ServiceType = 1
)

func (ServiceType) Descriptor

func (ServiceType) Enum

func (x ServiceType) Enum() *ServiceType

func (ServiceType) EnumDescriptor deprecated

func (ServiceType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ServiceType.Descriptor instead.

func (ServiceType) Number

func (x ServiceType) Number() protoreflect.EnumNumber

func (ServiceType) String

func (x ServiceType) String() string

func (ServiceType) Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL