commonpb

package module
v0.0.0-...-478bdc5 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TotalMode_name = map[int32]string{
		0: "AUTO",
		1: "NONE",
		2: "FORCE_EXACT",
	}
	TotalMode_value = map[string]int32{
		"AUTO":        0,
		"NONE":        1,
		"FORCE_EXACT": 2,
	}
)

Enum value maps for TotalMode.

View Source
var (
	TotalState_name = map[int32]string{
		0: "UNKNOWN",
		1: "EXACT",
		2: "SKIPPED",
	}
	TotalState_value = map[string]int32{
		"UNKNOWN": 0,
		"EXACT":   1,
		"SKIPPED": 2,
	}
)

Enum value maps for TotalState.

View Source
var (
	ErrorCode_name = map[int32]string{
		0: "SUCCESS",
		1: "INVALID_PARAM",
		2: "NO_AUTH",
		3: "NO_PERMISSION",
		4: "INNER_ERR",
		5: "NOT_FOUND",

		6:  "DATASET_NOT_FOUND",
		7:  "SUBJECT_NOT_FOUND",
		8:  "FIELD_NOT_FOUND",
		9:  "FACTOR_NOT_FOUND",
		10: "VIEW_NOT_FOUND",
		11: "VIEW_NOT_READY",
		12: "VIEW_COLUMN_NOT_FOUND",
		13: "QUERY_SHAPE_UNSUPPORTED",
		14: "CONFLICT",
		16: "ENGINE_CAPABILITY_UNSUPPORTED",
		17: "DIMENSION_VALUE_INVALID",
		18: "SUBJECT_NOT_IN_DATASET",
		19: "TRADE_SESSION_NOT_READY",
		20: "TRADE_ADOPTION_REQUIRED",
	}
	ErrorCode_value = map[string]int32{
		"SUCCESS":                       0,
		"INVALID_PARAM":                 1,
		"NO_AUTH":                       2,
		"NO_PERMISSION":                 3,
		"INNER_ERR":                     4,
		"NOT_FOUND":                     5,
		"SPACE_NOT_FOUND":               5,
		"DATASET_NOT_FOUND":             6,
		"SUBJECT_NOT_FOUND":             7,
		"FIELD_NOT_FOUND":               8,
		"FACTOR_NOT_FOUND":              9,
		"VIEW_NOT_FOUND":                10,
		"VIEW_NOT_READY":                11,
		"VIEW_COLUMN_NOT_FOUND":         12,
		"QUERY_SHAPE_UNSUPPORTED":       13,
		"CONFLICT":                      14,
		"ENGINE_CAPABILITY_UNSUPPORTED": 16,
		"DIMENSION_VALUE_INVALID":       17,
		"SUBJECT_NOT_IN_DATASET":        18,
		"TRADE_SESSION_NOT_READY":       19,
		"TRADE_ADOPTION_REQUIRED":       20,
	}
)

Enum value maps for ErrorCode.

View Source
var File_moox_common_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AuthInfo

type AuthInfo struct {

	// app_id 是调用方应用或服务 ID。
	AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"`
	// app_key 是调用方凭证,服务端应按敏感信息处理。
	AppKey string `protobuf:"bytes,2,opt,name=app_key,json=appKey,proto3" json:"app_key,omitempty"`
	// operator 是发起请求的用户、机器人或任务名。
	Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"`
	// request_id 是调用方传入的链路追踪 ID,也可用于幂等检查。
	RequestId string `protobuf:"bytes,4,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

AuthInfo 表示调用方身份和链路追踪信息。

func (*AuthInfo) Descriptor deprecated

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

Deprecated: Use AuthInfo.ProtoReflect.Descriptor instead.

func (*AuthInfo) GetAppId

func (x *AuthInfo) GetAppId() string

func (*AuthInfo) GetAppKey

func (x *AuthInfo) GetAppKey() string

func (*AuthInfo) GetOperator

func (x *AuthInfo) GetOperator() string

func (*AuthInfo) GetRequestId

func (x *AuthInfo) GetRequestId() string

func (*AuthInfo) ProtoMessage

func (*AuthInfo) ProtoMessage()

func (*AuthInfo) ProtoReflect

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

func (*AuthInfo) Reset

func (x *AuthInfo) Reset()

func (*AuthInfo) String

func (x *AuthInfo) String() string

type ErrorCode

type ErrorCode int32

ErrorCode 表示跨模块通用错误码。

const (
	// SUCCESS 表示请求成功。
	ErrorCode_SUCCESS ErrorCode = 0
	// INVALID_PARAM 表示请求参数错误。
	ErrorCode_INVALID_PARAM ErrorCode = 1
	// NO_AUTH 表示未认证或认证失败。
	ErrorCode_NO_AUTH ErrorCode = 2
	// NO_PERMISSION 表示没有操作权限。
	ErrorCode_NO_PERMISSION ErrorCode = 3
	// INNER_ERR 表示服务内部错误。
	ErrorCode_INNER_ERR ErrorCode = 4
	// NOT_FOUND 表示通用资源不存在。
	ErrorCode_NOT_FOUND ErrorCode = 5
	// SPACE_NOT_FOUND 表示使用空间不存在。
	ErrorCode_SPACE_NOT_FOUND ErrorCode = 5
	// DATASET_NOT_FOUND 表示数据集不存在。
	ErrorCode_DATASET_NOT_FOUND ErrorCode = 6
	// SUBJECT_NOT_FOUND 表示数据对象不存在。
	ErrorCode_SUBJECT_NOT_FOUND ErrorCode = 7
	// FIELD_NOT_FOUND 表示字段不存在。
	ErrorCode_FIELD_NOT_FOUND ErrorCode = 8
	// FACTOR_NOT_FOUND 表示因子不存在。
	ErrorCode_FACTOR_NOT_FOUND ErrorCode = 9
	// VIEW_NOT_FOUND 表示查询视图不存在。
	ErrorCode_VIEW_NOT_FOUND ErrorCode = 10
	// VIEW_NOT_READY 表示查询视图尚未就绪。
	ErrorCode_VIEW_NOT_READY ErrorCode = 11
	// VIEW_COLUMN_NOT_FOUND 表示查询视图列不存在或无法解析。
	ErrorCode_VIEW_COLUMN_NOT_FOUND ErrorCode = 12
	// QUERY_SHAPE_UNSUPPORTED 表示不支持当前查询形态。
	ErrorCode_QUERY_SHAPE_UNSUPPORTED ErrorCode = 13
	// CONFLICT 表示资源状态或版本已发生并发冲突。
	ErrorCode_CONFLICT ErrorCode = 14
	// ENGINE_CAPABILITY_UNSUPPORTED 表示所选存储引擎不支持该能力。
	ErrorCode_ENGINE_CAPABILITY_UNSUPPORTED ErrorCode = 16
	// DIMENSION_VALUE_INVALID 表示业务维度取值不合法。
	ErrorCode_DIMENSION_VALUE_INVALID ErrorCode = 17
	// SUBJECT_NOT_IN_DATASET 表示数据对象未登记到目标数据集。
	ErrorCode_SUBJECT_NOT_IN_DATASET ErrorCode = 18
	// TRADE_SESSION_NOT_READY 表示交易账户的交易所会话还没有启动(新建账户要等运行时的周期检查),稍后重试即可;请求没有发到交易所。
	ErrorCode_TRADE_SESSION_NOT_READY ErrorCode = 19
	// TRADE_ADOPTION_REQUIRED 表示执行账户上已有持仓或挂单,加入组合需要确认接管这些已有仓位。
	ErrorCode_TRADE_ADOPTION_REQUIRED ErrorCode = 20
)

func (ErrorCode) Descriptor

func (ErrorCode) Descriptor() protoreflect.EnumDescriptor

func (ErrorCode) Enum

func (x ErrorCode) Enum() *ErrorCode

func (ErrorCode) EnumDescriptor deprecated

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

Deprecated: Use ErrorCode.Descriptor instead.

func (ErrorCode) Number

func (x ErrorCode) Number() protoreflect.EnumNumber

func (ErrorCode) String

func (x ErrorCode) String() string

func (ErrorCode) Type

type Page

type Page struct {

	// page 是页号,从 1 开始;为 0 时由服务端使用默认值。
	Page uint32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	// size 是每页条数;为 0 时由服务端使用默认值。
	Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	// cursor 是游标分页使用的上一页返回游标;普通分页可为空。
	Cursor string `protobuf:"bytes,3,opt,name=cursor,proto3" json:"cursor,omitempty"`
	// contains filtered or unexported fields
}

Page 表示分页请求参数。

func (*Page) Descriptor deprecated

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

Deprecated: Use Page.ProtoReflect.Descriptor instead.

func (*Page) GetCursor

func (x *Page) GetCursor() string

func (*Page) GetPage

func (x *Page) GetPage() uint32

func (*Page) GetSize

func (x *Page) GetSize() uint32

func (*Page) ProtoMessage

func (*Page) ProtoMessage()

func (*Page) ProtoReflect

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

func (*Page) Reset

func (x *Page) Reset()

func (*Page) String

func (x *Page) String() string

type PageResult

type PageResult struct {

	// page 是本次返回对应的页号。
	Page uint32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	// size 是本次返回采用的每页条数。
	Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	// total 是结果总数;无法低成本计算时可为 0。使用 uint32 以保证 JSON 输出为数字。
	Total uint32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"`
	// has_more 表示是否还有更多结果。
	HasMore bool `protobuf:"varint,4,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"`
	// next_cursor 是下一页游标;普通分页可为空。
	NextCursor string `protobuf:"bytes,5,opt,name=next_cursor,json=nextCursor,proto3" json:"next_cursor,omitempty"`
	// total_state 表示 total 是否为精确总数。
	TotalState TotalState `protobuf:"varint,6,opt,name=total_state,json=totalState,proto3,enum=trpc.moox.common.TotalState" json:"total_state,omitempty"`
	// contains filtered or unexported fields
}

PageResult 表示分页返回结果。

func (*PageResult) Descriptor deprecated

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

Deprecated: Use PageResult.ProtoReflect.Descriptor instead.

func (*PageResult) GetHasMore

func (x *PageResult) GetHasMore() bool

func (*PageResult) GetNextCursor

func (x *PageResult) GetNextCursor() string

func (*PageResult) GetPage

func (x *PageResult) GetPage() uint32

func (*PageResult) GetSize

func (x *PageResult) GetSize() uint32

func (*PageResult) GetTotal

func (x *PageResult) GetTotal() uint32

func (*PageResult) GetTotalState

func (x *PageResult) GetTotalState() TotalState

func (*PageResult) ProtoMessage

func (*PageResult) ProtoMessage()

func (*PageResult) ProtoReflect

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

func (*PageResult) Reset

func (x *PageResult) Reset()

func (*PageResult) String

func (x *PageResult) String() string

type RetInfo

type RetInfo struct {

	// code 是机器可读的返回码。
	Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=trpc.moox.common.ErrorCode" json:"code,omitempty"`
	// msg 是面向人的返回说明。
	Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

RetInfo 表示通用接口返回状态。

func (*RetInfo) Descriptor deprecated

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

Deprecated: Use RetInfo.ProtoReflect.Descriptor instead.

func (*RetInfo) GetCode

func (x *RetInfo) GetCode() ErrorCode

func (*RetInfo) GetMsg

func (x *RetInfo) GetMsg() string

func (*RetInfo) ProtoMessage

func (*RetInfo) ProtoMessage()

func (*RetInfo) ProtoReflect

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

func (*RetInfo) Reset

func (x *RetInfo) Reset()

func (*RetInfo) String

func (x *RetInfo) String() string

type TotalMode

type TotalMode int32

TotalMode 控制接口是否计算精确总数。

const (
	// AUTO 表示由服务端按查询形态决定是否计算精确总数。
	TotalMode_AUTO TotalMode = 0
	// NONE 表示跳过精确总数计算。
	TotalMode_NONE TotalMode = 1
	// FORCE_EXACT 表示调用方要求计算精确总数。
	TotalMode_FORCE_EXACT TotalMode = 2
)

func (TotalMode) Descriptor

func (TotalMode) Descriptor() protoreflect.EnumDescriptor

func (TotalMode) Enum

func (x TotalMode) Enum() *TotalMode

func (TotalMode) EnumDescriptor deprecated

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

Deprecated: Use TotalMode.Descriptor instead.

func (TotalMode) Number

func (x TotalMode) Number() protoreflect.EnumNumber

func (TotalMode) String

func (x TotalMode) String() string

func (TotalMode) Type

type TotalState

type TotalState int32

TotalState 表示 PageResult.total 的可信状态。

const (
	// UNKNOWN 表示未设置 total 状态。
	TotalState_UNKNOWN TotalState = 0
	// EXACT 表示 total 是精确总数。
	TotalState_EXACT TotalState = 1
	// SKIPPED 表示服务端有意跳过了精确总数计算。
	TotalState_SKIPPED TotalState = 2
)

func (TotalState) Descriptor

func (TotalState) Descriptor() protoreflect.EnumDescriptor

func (TotalState) Enum

func (x TotalState) Enum() *TotalState

func (TotalState) EnumDescriptor deprecated

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

Deprecated: Use TotalState.Descriptor instead.

func (TotalState) Number

func (x TotalState) Number() protoreflect.EnumNumber

func (TotalState) String

func (x TotalState) String() string

func (TotalState) Type

Jump to

Keyboard shortcuts

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