fle-go
Field-Level Encryption with the Couchbase Go SDK — CryptoManager setup, encrypting and decrypting document fields
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Field-Level Encryption with the Couchbase Go SDK — CryptoManager setup, encrypting and decrypting document fields
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Couchbase SDK error handling — UnambiguousTimeoutException vs AmbiguousTimeoutException, DocumentNotFoundException, CasMismatchException, DurabilityImpossibleException, SDK debug logging, sdk-doctor connectivity diagnostics, retryable vs non-retryable errors, circuit breaker, error best practices
Couchbase SDK patterns for Rust — CAS optimistic locking, retry on CasMismatch, tokio bulk operations with join_all/FuturesUnordered, atomic counters, sub-document (MutateInSpec/LookupInSpec), array operations, exists, replica reads, touch/getAndTouch, preserve_expiry, error handling
Configure and optimize Couchbase SDK connections in Rust — async/tokio cluster setup, singleton pattern, wait_until_ready, timeouts, KV CRUD (upsert/insert/get/replace/remove), expiry, durability, sub-document operations
SQL++ queries with the Couchbase Rust SDK — scope.query, cluster.query, positional and named parameters, scan consistency, deserializing rows into structs, DML (INSERT/UPDATE/DELETE/UPSERT), MutationState RYOW
Testing Couchbase Rust applications — unit testing with mockall, integration testing with testcontainers-rs, scope/collection isolation
Distributed ACID transactions are not supported by the Couchbase Rust SDK 1.x — alternatives and workarounds
| name | fle-go |
| summary | Field-Level Encryption with the Couchbase Go SDK — CryptoManager setup, encrypting and decrypting document fields |
| description | Field-Level Encryption with the Couchbase Go SDK — CryptoManager setup, encrypting and decrypting document fields |
| compatibility | Go SDK 2.x. gocbencryption package required. |
| metadata | {"last_verified":"2026-05","min_server_version":"6.0","handoff":[{"condition":"user asks about FLE concepts or supported SDKs","skill":"fle"},{"condition":"user asks about connection setup","skill":"server-connection-go"}]} |
go get github.com/couchbase/gocbencryption/v2
import (
"github.com/couchbase/gocb/v2"
"github.com/couchbase/gocbencryption/v2"
)
keyBytes := make([]byte, 64) // 64-byte key for AES-256
keyring := gocbencryption.NewInsecureKeyring()
keyring.Add(gocbencryption.Key{ID: "my-key-id", Bytes: keyBytes})
provider := gocbencryption.NewAeadAes256CbcHmacSha512Provider(keyring)
cryptoMgr := gocbencryption.NewDefaultCryptoManager(nil)
cryptoMgr.RegisterEncrypter("my-encrypter", provider.EncrypterForKey("my-key-id"))
cryptoMgr.RegisterDecrypter(provider.Decrypter())
cluster, _ := gocb.Connect("couchbase://localhost", gocb.ClusterOptions{
Username: "username",
Password: "Password!123",
CryptoManager: cryptoMgr,
})
collection := cluster.Bucket("myapp").DefaultCollection()
type UserDoc struct {
Name string `json:"name"`
SSN string `json:"ssn"`
CreditCard string `json:"credit_card"`
}
doc := UserDoc{Name: "Alice", SSN: "123-45-6789", CreditCard: "4111111111111111"}
_, err := collection.Upsert("user::alice", doc, &gocb.UpsertOptions{
Transcoder: gocbencryption.NewEncryptingTranscoder(
gocb.NewJSONTranscoder(),
cryptoMgr,
[]gocbencryption.EncryptedField{
{Name: "ssn", EncrypterAlias: "my-encrypter"},
{Name: "credit_card", EncrypterAlias: "my-encrypter"},
},
),
})
var result UserDoc
getResult, _ := collection.Get("user::alice", &gocb.GetOptions{
Transcoder: gocbencryption.NewEncryptingTranscoder(
gocb.NewJSONTranscoder(),
cryptoMgr,
[]gocbencryption.EncryptedField{
{Name: "ssn"},
{Name: "credit_card"},
},
),
})
getResult.Content(&result)
fmt.Println(result.SSN) // "123-45-6789"
fle for full concept reference