testcodepb

package
v2.0.0-alpha.17 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Code generated by protoc-gen-deepcopy. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	Code_name = map[int32]string{
		0:      "OK",
		100000: "NotFound",
		100001: "Unknown",
		100003: "DbConn",
		100004: "UnknownCode",
		100005: "CustomCode",
	}
	Code_value = map[string]int32{
		"OK":          0,
		"NotFound":    100000,
		"Unknown":     100001,
		"DbConn":      100003,
		"UnknownCode": 100004,
		"CustomCode":  100005,
	}
)

Enum value maps for Code.

View Source
var (
	GenType_name = map[int32]string{
		0: "default",
		1: "uuid",
		2: "snowflake",
		3: "bigflake",
		4: "shortid",
	}
	GenType_value = map[string]int32{
		"default":   0,
		"uuid":      1,
		"snowflake": 2,
		"bigflake":  3,
		"shortid":   4,
	}
)

Enum value maps for GenType.

View Source
var (
	User_Role_Type_name = map[int32]string{
		0: "tenant",
		1: "guard",
		2: "manager",
		3: "admin",
	}
	User_Role_Type_value = map[string]int32{
		"tenant":  0,
		"guard":   1,
		"manager": 2,
		"admin":   3,
	}
)

Enum value maps for User_Role_Type.

View Source
var File_testcodepb_test_proto protoreflect.FileDescriptor
View Source
var TestErrCodeCustomCode = &errorpb.ErrCode{
	Code:       int32(100005),
	Message:    "this is custom msg",
	Name:       "demo.custom.code",
	StatusCode: errorpb.Code_OK,
}
View Source
var TestErrCodeDbConn = &errorpb.ErrCode{
	Code:       int32(100003),
	Message:    "db connect error",
	Name:       "demo.test.v1.db_conn",
	StatusCode: errorpb.Code_Internal,
}
View Source
var TestErrCodeNotFound = &errorpb.ErrCode{
	Code:       int32(100000),
	Message:    "not found 找不到",
	Name:       "demo.test.v1.not_found",
	StatusCode: errorpb.Code_NotFound,
}
View Source
var TestErrCodeOK = &errorpb.ErrCode{
	Code:       int32(0),
	Message:    "ok",
	Name:       "demo.test.v1.ok",
	StatusCode: errorpb.Code_OK,
}
View Source
var TestErrCodeUnknown = &errorpb.ErrCode{
	Code:       int32(100001),
	Message:    "unknown 未知",
	Name:       "demo.test.v1.unknown",
	StatusCode: errorpb.Code_NotFound,
}
View Source
var TestErrCodeUnknownCode = &errorpb.ErrCode{
	Code:       int32(100004),
	Message:    "default code",
	Name:       "demo.test.v1.unknown_code",
	StatusCode: errorpb.Code_Internal,
}

Functions

func CodeValues

func CodeValues() []string

func GenTypeValues

func GenTypeValues() []string

func User_Role_TypeValues

func User_Role_TypeValues() []string

Types

type ChatMessage

type ChatMessage struct {
	Name      string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	SessionId string   `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	Msg       *Message `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*ChatMessage) Descriptor deprecated

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

Deprecated: Use ChatMessage.ProtoReflect.Descriptor instead.

func (*ChatMessage) GetMsg

func (x *ChatMessage) GetMsg() *Message

func (*ChatMessage) GetName

func (x *ChatMessage) GetName() string

func (*ChatMessage) GetSessionId

func (x *ChatMessage) GetSessionId() string

func (*ChatMessage) ProtoMessage

func (*ChatMessage) ProtoMessage()

func (*ChatMessage) ProtoReflect

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

func (*ChatMessage) Reset

func (x *ChatMessage) Reset()

func (*ChatMessage) String

func (x *ChatMessage) String() string

type Code

type Code int32
const (
	Code_OK Code = 0
	// NotFound 找不到
	Code_NotFound Code = 100000
	// Unknown 未知
	Code_Unknown Code = 100001
	// db connect error
	Code_DbConn Code = 100003
	// default code
	Code_UnknownCode Code = 100004
	// custom msg, 注释可以做其他的操作
	Code_CustomCode Code = 100005
)

func CodeDecode

func CodeDecode(name string) Code

func (Code) Descriptor

func (Code) Descriptor() protoreflect.EnumDescriptor

func (Code) Enum

func (x Code) Enum() *Code

func (Code) EnumDescriptor deprecated

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

Deprecated: Use Code.Descriptor instead.

func (Code) Number

func (x Code) Number() protoreflect.EnumNumber

func (Code) String

func (x Code) String() string

func (Code) Type

func (Code) Type() protoreflect.EnumType

type DoProxyEventReq

type DoProxyEventReq struct {
	// contains filtered or unexported fields
}

func (*DoProxyEventReq) Descriptor deprecated

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

Deprecated: Use DoProxyEventReq.ProtoReflect.Descriptor instead.

func (*DoProxyEventReq) ProtoMessage

func (*DoProxyEventReq) ProtoMessage()

func (*DoProxyEventReq) ProtoReflect

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

func (*DoProxyEventReq) Reset

func (x *DoProxyEventReq) Reset()

func (*DoProxyEventReq) String

func (x *DoProxyEventReq) String() string

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type GenType

type GenType int32
const (
	GenType_default   GenType = 0
	GenType_uuid      GenType = 1
	GenType_snowflake GenType = 2
	GenType_bigflake  GenType = 3
	GenType_shortid   GenType = 4
)

func GenTypeDecode

func GenTypeDecode(name string) GenType

func (GenType) Descriptor

func (GenType) Descriptor() protoreflect.EnumDescriptor

func (GenType) Enum

func (x GenType) Enum() *GenType

func (GenType) EnumDescriptor deprecated

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

Deprecated: Use GenType.Descriptor instead.

func (GenType) Number

func (x GenType) Number() protoreflect.EnumNumber

func (GenType) String

func (x GenType) String() string

func (GenType) Type

func (GenType) Type() protoreflect.EnumType

type GenerateRequest

type GenerateRequest struct {

	// type of id e.g uuid, shortid, snowflake (64 bit), bigflake (128 bit)
	Type GenType `protobuf:"varint,1,opt,name=type,proto3,enum=demo.test.v1.GenType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

Generate a unique ID. Defaults to uuid.

func (*GenerateRequest) Descriptor deprecated

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

Deprecated: Use GenerateRequest.ProtoReflect.Descriptor instead.

func (*GenerateRequest) GetType

func (x *GenerateRequest) GetType() GenType

func (*GenerateRequest) ProtoMessage

func (*GenerateRequest) ProtoMessage()

func (*GenerateRequest) ProtoReflect

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

func (*GenerateRequest) Reset

func (x *GenerateRequest) Reset()

func (*GenerateRequest) String

func (x *GenerateRequest) String() string

type GenerateResponse

type GenerateResponse struct {

	// the unique id generated
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// the type of id generated
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*GenerateResponse) Descriptor deprecated

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

Deprecated: Use GenerateResponse.ProtoReflect.Descriptor instead.

func (*GenerateResponse) GetId

func (x *GenerateResponse) GetId() string

func (*GenerateResponse) GetType

func (x *GenerateResponse) GetType() string

func (*GenerateResponse) ProtoMessage

func (*GenerateResponse) ProtoMessage()

func (*GenerateResponse) ProtoReflect

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

func (*GenerateResponse) Reset

func (x *GenerateResponse) Reset()

func (*GenerateResponse) String

func (x *GenerateResponse) String() string

type Message

type Message struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetName

func (x *Message) GetName() string

func (*Message) GetText

func (x *Message) GetText() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type TypesRequest

type TypesRequest struct {
	Name   string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	NameId uint64 `protobuf:"varint,2,opt,name=name_id,json=nameId,proto3" json:"name_id,omitempty"`
	Hello  string `protobuf:"bytes,3,opt,name=hello,proto3" json:"hello,omitempty"`
	// contains filtered or unexported fields
}

List the types of IDs available. No query params needed.

func (*TypesRequest) Descriptor deprecated

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

Deprecated: Use TypesRequest.ProtoReflect.Descriptor instead.

func (*TypesRequest) GetHello

func (x *TypesRequest) GetHello() string

func (*TypesRequest) GetName

func (x *TypesRequest) GetName() string

func (*TypesRequest) GetNameId

func (x *TypesRequest) GetNameId() uint64

func (*TypesRequest) ProtoMessage

func (*TypesRequest) ProtoMessage()

func (*TypesRequest) ProtoReflect

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

func (*TypesRequest) Reset

func (x *TypesRequest) Reset()

func (*TypesRequest) String

func (x *TypesRequest) String() string

type TypesResponse

type TypesResponse struct {
	Types []string `protobuf:"bytes,1,rep,name=types,proto3" json:"types,omitempty"`
	// contains filtered or unexported fields
}

TypesResponse 返回值类型

func (*TypesResponse) Descriptor deprecated

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

Deprecated: Use TypesResponse.ProtoReflect.Descriptor instead.

func (*TypesResponse) GetTypes

func (x *TypesResponse) GetTypes() []string

func (*TypesResponse) ProtoMessage

func (*TypesResponse) ProtoMessage()

func (*TypesResponse) ProtoReflect

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

func (*TypesResponse) Reset

func (x *TypesResponse) Reset()

func (*TypesResponse) String

func (x *TypesResponse) String() string

type UploadFileRequest

type UploadFileRequest struct {
	Filename string             `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"`
	File     *httpbody.HttpBody `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadFileRequest) Descriptor deprecated

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

Deprecated: Use UploadFileRequest.ProtoReflect.Descriptor instead.

func (*UploadFileRequest) GetFile

func (x *UploadFileRequest) GetFile() *httpbody.HttpBody

func (*UploadFileRequest) GetFilename

func (x *UploadFileRequest) GetFilename() string

func (*UploadFileRequest) ProtoMessage

func (*UploadFileRequest) ProtoMessage()

func (*UploadFileRequest) ProtoReflect

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

func (*UploadFileRequest) Reset

func (x *UploadFileRequest) Reset()

func (*UploadFileRequest) String

func (x *UploadFileRequest) String() string

type User

type User struct {
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

type User_Role

type User_Role struct {
	// contains filtered or unexported fields
}

func (*User_Role) Descriptor deprecated

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

Deprecated: Use User_Role.ProtoReflect.Descriptor instead.

func (*User_Role) ProtoMessage

func (*User_Role) ProtoMessage()

func (*User_Role) ProtoReflect

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

func (*User_Role) Reset

func (x *User_Role) Reset()

func (*User_Role) String

func (x *User_Role) String() string

type User_Role_Type

type User_Role_Type int32
const (
	// 租户
	User_Role_tenant User_Role_Type = 0
	// 安保
	User_Role_guard User_Role_Type = 1
	// 管理者
	User_Role_manager User_Role_Type = 2
	// 后台管理员
	User_Role_admin User_Role_Type = 3
)

func User_Role_TypeDecode

func User_Role_TypeDecode(name string) User_Role_Type

func (User_Role_Type) Descriptor

func (User_Role_Type) Enum

func (x User_Role_Type) Enum() *User_Role_Type

func (User_Role_Type) EnumDescriptor deprecated

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

Deprecated: Use User_Role_Type.Descriptor instead.

func (User_Role_Type) Number

func (User_Role_Type) String

func (x User_Role_Type) String() string

func (User_Role_Type) Type

Jump to

Keyboard shortcuts

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