d-engine-proto 0.2.4

gRPC protocol definitions - for building non-Rust d-engine clients
Documentation
syntax = "proto3";
package d_engine.error;

option go_package = "github.com/deventlab/d-engine/proto/error";


enum ErrorCode {
    // Success status (non-error)
    SUCCESS = 0;

    // ======================
    // Network layer error (1000-1999)
    // ======================
    CONNECTION_TIMEOUT = 1001;
    INVALID_ADDRESS = 1002;
    LEADER_CHANGED = 1003;
    JOIN_ERROR = 1004;

    // ======================
    // Protocol layer error (2000-2999)
    // ======================
    INVALID_RESPONSE = 2001;
    VERSION_MISMATCH = 2002;

    // ======================
    // Storage layer error (3000-3999)
    // ======================
    DISK_FULL = 3001;
    DATA_CORRUPTION = 3002;
    STORAGE_IO_ERROR = 3003;
    STORAGE_PERMISSION_DENIED = 3004;
    KEY_NOT_EXIST = 3005;

    // ======================
    // Business logic error (4000-4999)
    // ======================
    NOT_LEADER = 4001;
    STALE_OPERATION = 4002;
    INVALID_REQUEST = 4003;
    RATE_LIMITED = 4004;
    CLUSTER_UNAVAILABLE = 4005;
    PROPOSE_FAILED = 4006;
    TERM_OUTDATED = 4007;
    RETRY_REQUIRED = 4008;

    // ======================
    // Watch layer error (5000-5999)
    // ======================
    // per-watcher channel full; watcher forcibly canceled, client must re-sync
    WATCH_BUFFER_OVERFLOW = 5001;

    // ======================
    // Unclassified error
    // ======================
    GENERAL = 8888;
    UNCATEGORIZED = 9999;
}

message ErrorMetadata {
    // Errors suitable for retry
    optional uint64 retry_after_ms = 1;

    // Leader change information
    optional string leader_id = 2;
    optional string leader_address = 3;

    // Error details (for debugging only)
    optional string debug_message = 15;
}