chore: update the module path in grpc proto file
Some checks failed
Go Tests / Run Tests (1.24.2) (push) Failing after 15m4s
Some checks failed
Go Tests / Run Tests (1.24.2) (push) Failing after 15m4s
This commit is contained in:
parent
86194e5daa
commit
7f825cae46
@ -16,7 +16,7 @@ This package provides a Go client for connecting to a Kevo database server. The
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
go get github.com/jeremytregunna/kevo
|
||||
go get github.com/KevoDB/kevo
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
@ -29,48 +29,48 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/jeremytregunna/kevo/pkg/client"
|
||||
_ "github.com/jeremytregunna/kevo/pkg/grpc/transport" // Register gRPC transport
|
||||
"github.com/KevoDB/kevo/pkg/client"
|
||||
_ "github.com/KevoDB/kevo/pkg/grpc/transport" // Register gRPC transport
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a client with default options
|
||||
options := client.DefaultClientOptions()
|
||||
options.Endpoint = "localhost:50051"
|
||||
|
||||
|
||||
c, err := client.NewClient(options)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create client: %v", err)
|
||||
}
|
||||
|
||||
|
||||
// Connect to the server
|
||||
ctx := context.Background()
|
||||
if err := c.Connect(ctx); err != nil {
|
||||
log.Fatalf("Failed to connect: %v", err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
|
||||
// Basic key-value operations
|
||||
key := []byte("hello")
|
||||
value := []byte("world")
|
||||
|
||||
|
||||
// Store a value
|
||||
if _, err := c.Put(ctx, key, value, true); err != nil {
|
||||
log.Fatalf("Put failed: %v", err)
|
||||
}
|
||||
|
||||
|
||||
// Retrieve a value
|
||||
val, found, err := c.Get(ctx, key)
|
||||
if err != nil {
|
||||
log.Fatalf("Get failed: %v", err)
|
||||
}
|
||||
|
||||
|
||||
if found {
|
||||
fmt.Printf("Value: %s\n", val)
|
||||
} else {
|
||||
fmt.Println("Key not found")
|
||||
}
|
||||
|
||||
|
||||
// Delete a value
|
||||
if _, err := c.Delete(ctx, key, true); err != nil {
|
||||
log.Fatalf("Delete failed: %v", err)
|
||||
@ -90,20 +90,20 @@ options := client.ClientOptions{
|
||||
RequestTimeout: 10 * time.Second,
|
||||
TransportType: "grpc",
|
||||
PoolSize: 5,
|
||||
|
||||
|
||||
// Security options
|
||||
TLSEnabled: true,
|
||||
CertFile: "/path/to/cert.pem",
|
||||
KeyFile: "/path/to/key.pem",
|
||||
CAFile: "/path/to/ca.pem",
|
||||
|
||||
|
||||
// Retry options
|
||||
MaxRetries: 3,
|
||||
InitialBackoff: 100 * time.Millisecond,
|
||||
MaxBackoff: 2 * time.Second,
|
||||
BackoffFactor: 1.5,
|
||||
RetryJitter: 0.2,
|
||||
|
||||
|
||||
// Performance options
|
||||
Compression: client.CompressionGzip,
|
||||
MaxMessageSize: 16 * 1024 * 1024, // 16MB
|
||||
@ -223,4 +223,4 @@ success, err := client.Compact(ctx, false) // force=false
|
||||
if err != nil {
|
||||
log.Fatalf("Compaction failed: %v", err)
|
||||
}
|
||||
```
|
||||
```
|
||||
|
@ -2,35 +2,35 @@ syntax = "proto3";
|
||||
|
||||
package kevo;
|
||||
|
||||
option go_package = "github.com/jeremytregunna/kevo/pkg/grpc/proto;proto";
|
||||
option go_package = "github.com/KevoDB/kevo/pkg/grpc/proto;proto";
|
||||
|
||||
service KevoService {
|
||||
// Key-Value Operations
|
||||
rpc Get(GetRequest) returns (GetResponse);
|
||||
rpc Put(PutRequest) returns (PutResponse);
|
||||
rpc Delete(DeleteRequest) returns (DeleteResponse);
|
||||
|
||||
|
||||
// Batch Operations
|
||||
rpc BatchWrite(BatchWriteRequest) returns (BatchWriteResponse);
|
||||
|
||||
|
||||
// Iterator Operations
|
||||
rpc Scan(ScanRequest) returns (stream ScanResponse);
|
||||
|
||||
|
||||
// Transaction Operations
|
||||
rpc BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse);
|
||||
rpc CommitTransaction(CommitTransactionRequest) returns (CommitTransactionResponse);
|
||||
rpc RollbackTransaction(RollbackTransactionRequest) returns (RollbackTransactionResponse);
|
||||
|
||||
|
||||
// Transaction Operations within an active transaction
|
||||
rpc TxGet(TxGetRequest) returns (TxGetResponse);
|
||||
rpc TxPut(TxPutRequest) returns (TxPutResponse);
|
||||
rpc TxDelete(TxDeleteRequest) returns (TxDeleteResponse);
|
||||
rpc TxScan(TxScanRequest) returns (stream TxScanResponse);
|
||||
|
||||
|
||||
// Administrative Operations
|
||||
rpc GetStats(GetStatsRequest) returns (GetStatsResponse);
|
||||
rpc Compact(CompactRequest) returns (CompactResponse);
|
||||
|
||||
|
||||
// Replication and Topology Operations
|
||||
rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse);
|
||||
}
|
||||
@ -176,7 +176,7 @@ message GetStatsResponse {
|
||||
int32 sstable_count = 4;
|
||||
double write_amplification = 5;
|
||||
double read_amplification = 6;
|
||||
|
||||
|
||||
// Operation counts
|
||||
map<string, uint64> operation_counts = 7;
|
||||
// Latency statistics
|
||||
@ -214,7 +214,7 @@ message CompactResponse {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
// Node information and topology
|
||||
// Node information and topology
|
||||
message GetNodeInfoRequest {
|
||||
// No parameters needed for now
|
||||
}
|
||||
@ -227,11 +227,11 @@ message GetNodeInfoResponse {
|
||||
REPLICA = 2;
|
||||
}
|
||||
NodeRole node_role = 1;
|
||||
|
||||
|
||||
// Connection information
|
||||
string primary_address = 2; // Empty if standalone
|
||||
repeated ReplicaInfo replicas = 3; // Empty if standalone
|
||||
|
||||
|
||||
// Node status
|
||||
uint64 last_sequence = 4; // Last applied sequence number
|
||||
bool read_only = 5; // Whether the node is in read-only mode
|
||||
@ -243,4 +243,4 @@ message ReplicaInfo {
|
||||
bool available = 3; // Whether the replica is available
|
||||
string region = 4; // Optional region information
|
||||
map<string, string> meta = 5; // Additional metadata
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user