d-engine-proto 0.2.3

gRPC protocol definitions - for building non-Rust d-engine clients
Documentation
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.11
// 	protoc        v6.33.0
// source: proto/error.proto

package error

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type ErrorCode int32

const (
	// Success status (non-error)
	ErrorCode_SUCCESS ErrorCode = 0
	// ======================
	// Network layer error (1000-1999)
	// ======================
	ErrorCode_CONNECTION_TIMEOUT ErrorCode = 1001
	ErrorCode_INVALID_ADDRESS    ErrorCode = 1002
	ErrorCode_LEADER_CHANGED     ErrorCode = 1003
	ErrorCode_JOIN_ERROR         ErrorCode = 1004
	// ======================
	// Protocol layer error (2000-2999)
	// ======================
	ErrorCode_INVALID_RESPONSE ErrorCode = 2001
	ErrorCode_VERSION_MISMATCH ErrorCode = 2002
	// ======================
	// Storage layer error (3000-3999)
	// ======================
	ErrorCode_DISK_FULL                 ErrorCode = 3001
	ErrorCode_DATA_CORRUPTION           ErrorCode = 3002
	ErrorCode_STORAGE_IO_ERROR          ErrorCode = 3003
	ErrorCode_STORAGE_PERMISSION_DENIED ErrorCode = 3004
	ErrorCode_KEY_NOT_EXIST             ErrorCode = 3005
	// ======================
	// Business logic error (4000-4999)
	// ======================
	ErrorCode_NOT_LEADER          ErrorCode = 4001
	ErrorCode_STALE_OPERATION     ErrorCode = 4002
	ErrorCode_INVALID_REQUEST     ErrorCode = 4003
	ErrorCode_RATE_LIMITED        ErrorCode = 4004
	ErrorCode_CLUSTER_UNAVAILABLE ErrorCode = 4005
	ErrorCode_PROPOSE_FAILED      ErrorCode = 4006
	ErrorCode_TERM_OUTDATED       ErrorCode = 4007
	ErrorCode_RETRY_REQUIRED      ErrorCode = 4008
	// ======================
	// Unclassified error
	// ======================
	ErrorCode_GENERAL       ErrorCode = 8888
	ErrorCode_UNCATEGORIZED ErrorCode = 9999
)

// Enum value maps for ErrorCode.
var (
	ErrorCode_name = map[int32]string{
		0:    "SUCCESS",
		1001: "CONNECTION_TIMEOUT",
		1002: "INVALID_ADDRESS",
		1003: "LEADER_CHANGED",
		1004: "JOIN_ERROR",
		2001: "INVALID_RESPONSE",
		2002: "VERSION_MISMATCH",
		3001: "DISK_FULL",
		3002: "DATA_CORRUPTION",
		3003: "STORAGE_IO_ERROR",
		3004: "STORAGE_PERMISSION_DENIED",
		3005: "KEY_NOT_EXIST",
		4001: "NOT_LEADER",
		4002: "STALE_OPERATION",
		4003: "INVALID_REQUEST",
		4004: "RATE_LIMITED",
		4005: "CLUSTER_UNAVAILABLE",
		4006: "PROPOSE_FAILED",
		4007: "TERM_OUTDATED",
		4008: "RETRY_REQUIRED",
		8888: "GENERAL",
		9999: "UNCATEGORIZED",
	}
	ErrorCode_value = map[string]int32{
		"SUCCESS":                   0,
		"CONNECTION_TIMEOUT":        1001,
		"INVALID_ADDRESS":           1002,
		"LEADER_CHANGED":            1003,
		"JOIN_ERROR":                1004,
		"INVALID_RESPONSE":          2001,
		"VERSION_MISMATCH":          2002,
		"DISK_FULL":                 3001,
		"DATA_CORRUPTION":           3002,
		"STORAGE_IO_ERROR":          3003,
		"STORAGE_PERMISSION_DENIED": 3004,
		"KEY_NOT_EXIST":             3005,
		"NOT_LEADER":                4001,
		"STALE_OPERATION":           4002,
		"INVALID_REQUEST":           4003,
		"RATE_LIMITED":              4004,
		"CLUSTER_UNAVAILABLE":       4005,
		"PROPOSE_FAILED":            4006,
		"TERM_OUTDATED":             4007,
		"RETRY_REQUIRED":            4008,
		"GENERAL":                   8888,
		"UNCATEGORIZED":             9999,
	}
)

func (x ErrorCode) Enum() *ErrorCode {
	p := new(ErrorCode)
	*p = x
	return p
}

func (x ErrorCode) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (ErrorCode) Descriptor() protoreflect.EnumDescriptor {
	return file_proto_error_proto_enumTypes[0].Descriptor()
}

func (ErrorCode) Type() protoreflect.EnumType {
	return &file_proto_error_proto_enumTypes[0]
}

func (x ErrorCode) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use ErrorCode.Descriptor instead.
func (ErrorCode) EnumDescriptor() ([]byte, []int) {
	return file_proto_error_proto_rawDescGZIP(), []int{0}
}

type ErrorMetadata struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Errors suitable for retry
	RetryAfterMs *uint64 `protobuf:"varint,1,opt,name=retry_after_ms,json=retryAfterMs,proto3,oneof" json:"retry_after_ms,omitempty"`
	// Leader change information
	LeaderId      *string `protobuf:"bytes,2,opt,name=leader_id,json=leaderId,proto3,oneof" json:"leader_id,omitempty"`
	LeaderAddress *string `protobuf:"bytes,3,opt,name=leader_address,json=leaderAddress,proto3,oneof" json:"leader_address,omitempty"`
	// Error details (for debugging only)
	DebugMessage  *string `protobuf:"bytes,15,opt,name=debug_message,json=debugMessage,proto3,oneof" json:"debug_message,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *ErrorMetadata) Reset() {
	*x = ErrorMetadata{}
	mi := &file_proto_error_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *ErrorMetadata) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*ErrorMetadata) ProtoMessage() {}

func (x *ErrorMetadata) ProtoReflect() protoreflect.Message {
	mi := &file_proto_error_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use ErrorMetadata.ProtoReflect.Descriptor instead.
func (*ErrorMetadata) Descriptor() ([]byte, []int) {
	return file_proto_error_proto_rawDescGZIP(), []int{0}
}

func (x *ErrorMetadata) GetRetryAfterMs() uint64 {
	if x != nil && x.RetryAfterMs != nil {
		return *x.RetryAfterMs
	}
	return 0
}

func (x *ErrorMetadata) GetLeaderId() string {
	if x != nil && x.LeaderId != nil {
		return *x.LeaderId
	}
	return ""
}

func (x *ErrorMetadata) GetLeaderAddress() string {
	if x != nil && x.LeaderAddress != nil {
		return *x.LeaderAddress
	}
	return ""
}

func (x *ErrorMetadata) GetDebugMessage() string {
	if x != nil && x.DebugMessage != nil {
		return *x.DebugMessage
	}
	return ""
}

var File_proto_error_proto protoreflect.FileDescriptor

const file_proto_error_proto_rawDesc = "" +
	"\n" +
	"\x11proto/error.proto\x12\x0ed_engine.error\"\xf8\x01\n" +
	"\rErrorMetadata\x12)\n" +
	"\x0eretry_after_ms\x18\x01 \x01(\x04H\x00R\fretryAfterMs\x88\x01\x01\x12 \n" +
	"\tleader_id\x18\x02 \x01(\tH\x01R\bleaderId\x88\x01\x01\x12*\n" +
	"\x0eleader_address\x18\x03 \x01(\tH\x02R\rleaderAddress\x88\x01\x01\x12(\n" +
	"\rdebug_message\x18\x0f \x01(\tH\x03R\fdebugMessage\x88\x01\x01B\x11\n" +
	"\x0f_retry_after_msB\f\n" +
	"\n" +
	"_leader_idB\x11\n" +
	"\x0f_leader_addressB\x10\n" +
	"\x0e_debug_message*\xd6\x03\n" +
	"\tErrorCode\x12\v\n" +
	"\aSUCCESS\x10\x00\x12\x17\n" +
	"\x12CONNECTION_TIMEOUT\x10\xe9\a\x12\x14\n" +
	"\x0fINVALID_ADDRESS\x10\xea\a\x12\x13\n" +
	"\x0eLEADER_CHANGED\x10\xeb\a\x12\x0f\n" +
	"\n" +
	"JOIN_ERROR\x10\xec\a\x12\x15\n" +
	"\x10INVALID_RESPONSE\x10\xd1\x0f\x12\x15\n" +
	"\x10VERSION_MISMATCH\x10\xd2\x0f\x12\x0e\n" +
	"\tDISK_FULL\x10\xb9\x17\x12\x14\n" +
	"\x0fDATA_CORRUPTION\x10\xba\x17\x12\x15\n" +
	"\x10STORAGE_IO_ERROR\x10\xbb\x17\x12\x1e\n" +
	"\x19STORAGE_PERMISSION_DENIED\x10\xbc\x17\x12\x12\n" +
	"\rKEY_NOT_EXIST\x10\xbd\x17\x12\x0f\n" +
	"\n" +
	"NOT_LEADER\x10\xa1\x1f\x12\x14\n" +
	"\x0fSTALE_OPERATION\x10\xa2\x1f\x12\x14\n" +
	"\x0fINVALID_REQUEST\x10\xa3\x1f\x12\x11\n" +
	"\fRATE_LIMITED\x10\xa4\x1f\x12\x18\n" +
	"\x13CLUSTER_UNAVAILABLE\x10\xa5\x1f\x12\x13\n" +
	"\x0ePROPOSE_FAILED\x10\xa6\x1f\x12\x12\n" +
	"\rTERM_OUTDATED\x10\xa7\x1f\x12\x13\n" +
	"\x0eRETRY_REQUIRED\x10\xa8\x1f\x12\f\n" +
	"\aGENERAL\x10\xb8E\x12\x12\n" +
	"\rUNCATEGORIZED\x10\x8fNB+Z)github.com/deventlab/d-engine/proto/errorb\x06proto3"

var (
	file_proto_error_proto_rawDescOnce sync.Once
	file_proto_error_proto_rawDescData []byte
)

func file_proto_error_proto_rawDescGZIP() []byte {
	file_proto_error_proto_rawDescOnce.Do(func() {
		file_proto_error_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_error_proto_rawDesc), len(file_proto_error_proto_rawDesc)))
	})
	return file_proto_error_proto_rawDescData
}

var file_proto_error_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_proto_error_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_proto_error_proto_goTypes = []any{
	(ErrorCode)(0),        // 0: d_engine.error.ErrorCode
	(*ErrorMetadata)(nil), // 1: d_engine.error.ErrorMetadata
}
var file_proto_error_proto_depIdxs = []int32{
	0, // [0:0] is the sub-list for method output_type
	0, // [0:0] is the sub-list for method input_type
	0, // [0:0] is the sub-list for extension type_name
	0, // [0:0] is the sub-list for extension extendee
	0, // [0:0] is the sub-list for field type_name
}

func init() { file_proto_error_proto_init() }
func file_proto_error_proto_init() {
	if File_proto_error_proto != nil {
		return
	}
	file_proto_error_proto_msgTypes[0].OneofWrappers = []any{}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_error_proto_rawDesc), len(file_proto_error_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_proto_error_proto_goTypes,
		DependencyIndexes: file_proto_error_proto_depIdxs,
		EnumInfos:         file_proto_error_proto_enumTypes,
		MessageInfos:      file_proto_error_proto_msgTypes,
	}.Build()
	File_proto_error_proto = out.File
	file_proto_error_proto_goTypes = nil
	file_proto_error_proto_depIdxs = nil
}