types

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorCode_name = map[int32]string{
		0:  "ERROR_CODE_UNKNOWN",
		1:  "ERROR_CODE_INVALID_ID",
		2:  "ERROR_CODE_INVALID_EMAIL",
		3:  "ERROR_CODE_INVALID_PASSWORD",
		4:  "ERROR_CODE_INVALID_TITLE",
		5:  "ERROR_CODE_INVALID_CONTENT",
		6:  "ERROR_CODE_ENTITY_NOT_FOUND",
		7:  "ERROR_CODE_PERMISSION_DENIED",
		8:  "ERROR_CODE_BUSINESS",
		9:  "ERROR_CODE_INVALID_TEXT",
		99: "ERROR_CODE_INTERNAL",
	}
	ErrorCode_value = map[string]int32{
		"ERROR_CODE_UNKNOWN":           0,
		"ERROR_CODE_INVALID_ID":        1,
		"ERROR_CODE_INVALID_EMAIL":     2,
		"ERROR_CODE_INVALID_PASSWORD":  3,
		"ERROR_CODE_INVALID_TITLE":     4,
		"ERROR_CODE_INVALID_CONTENT":   5,
		"ERROR_CODE_ENTITY_NOT_FOUND":  6,
		"ERROR_CODE_PERMISSION_DENIED": 7,
		"ERROR_CODE_BUSINESS":          8,
		"ERROR_CODE_INVALID_TEXT":      9,
		"ERROR_CODE_INTERNAL":          99,
	}
)

Enum value maps for ErrorCode.

View Source
var File_api_types_error_proto protoreflect.FileDescriptor
View Source
var File_api_types_id_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Error

type Error struct {

	// Readable error code.
	Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=api.types.ErrorCode" json:"code,omitempty"`
	// Human-readable explanation of the error.
	//
	// Intended for debugging or displaying to end users.
	Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
	// contains filtered or unexported fields
}

Error represents a structured error returned by the API.

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() ErrorCode

func (*Error) GetReason

func (x *Error) GetReason() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

func (*Error) Verbose

func (x *Error) Verbose() string

type ErrorCode

type ErrorCode int32

ErrorCode represents a readable error classification.

const (
	// Unknown or unspecified error.
	ErrorCode_ERROR_CODE_UNKNOWN ErrorCode = 0
	// The provided identifier is invalid or malformed.
	ErrorCode_ERROR_CODE_INVALID_ID ErrorCode = 1
	// The provided email address is invalid.
	ErrorCode_ERROR_CODE_INVALID_EMAIL ErrorCode = 2
	// The provided password does not meet validation requirements.
	ErrorCode_ERROR_CODE_INVALID_PASSWORD ErrorCode = 3
	// The provided title is invalid.
	ErrorCode_ERROR_CODE_INVALID_TITLE ErrorCode = 4
	// The provided content is invalid.
	ErrorCode_ERROR_CODE_INVALID_CONTENT ErrorCode = 5
	// The requested entity does not exist.
	ErrorCode_ERROR_CODE_ENTITY_NOT_FOUND ErrorCode = 6
	// The caller does not have permission to perform the requested operation.
	ErrorCode_ERROR_CODE_PERMISSION_DENIED ErrorCode = 7
	// General business logic error (e.g., domain rule violation).
	ErrorCode_ERROR_CODE_BUSINESS ErrorCode = 8
	// The provided text is invalid.
	ErrorCode_ERROR_CODE_INVALID_TEXT ErrorCode = 9
	// Internal server error.
	ErrorCode_ERROR_CODE_INTERNAL ErrorCode = 99
)

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 ID

type ID struct {

	// The numeric value of the ID.
	Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

ID represents a unique identifier for an entity.

Typically used as a wrapper around a numeric value to ensure type safety across different entities.

func (*ID) Descriptor deprecated

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

Deprecated: Use ID.ProtoReflect.Descriptor instead.

func (*ID) GetValue

func (x *ID) GetValue() int64

func (*ID) ProtoMessage

func (*ID) ProtoMessage()

func (*ID) ProtoReflect

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

func (*ID) Reset

func (x *ID) Reset()

func (*ID) String

func (x *ID) String() string

func (*ID) Verbose

func (x *ID) Verbose() string

Jump to

Keyboard shortcuts

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