[{"data":1,"prerenderedAt":565},["ShallowReactive",2],{"content-query-AzpQ8u7kXM":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"sidebar_position":10,"body":11,"_type":559,"_id":560,"_source":561,"_file":562,"_stem":563,"_extension":564},"\u002Fdocs\u002Fsdks\u002Fgo","sdks",false,"","Go SDK","The official CredVault SDK for Go applications. Built with Go idioms in mind, this SDK provides efficient, type-safe access to the platform.",4,{"type":12,"children":13,"toc":547},"root",[14,22,27,34,39,44,49,55,60,66,71,105,111,116,239,244,250,255,266,276,286,296,302,307,312,318,323,458,463,469,474,479,485,490,496,506,516,526,536,541],{"type":15,"tag":16,"props":17,"children":19},"element","h1",{"id":18},"go-sdk",[20],{"type":21,"value":8},"text",{"type":15,"tag":23,"props":24,"children":25},"p",{},[26],{"type":21,"value":9},{"type":15,"tag":28,"props":29,"children":31},"h2",{"id":30},"why-use-the-go-sdk",[32],{"type":21,"value":33},"Why Use the Go SDK?",{"type":15,"tag":23,"props":35,"children":36},{},[37],{"type":21,"value":38},"Go excels at building high-performance backend services, and the CredVault Go SDK is designed to match. The SDK uses minimal dependencies — just the standard library — keeping your builds fast and your binaries small.",{"type":15,"tag":23,"props":40,"children":41},{},[42],{"type":21,"value":43},"Error handling follows Go conventions with explicit error returns. No hidden exceptions or panics. Every operation that might fail returns an error value for you to handle.",{"type":15,"tag":23,"props":45,"children":46},{},[47],{"type":21,"value":48},"The SDK is safe for concurrent use. Share a single client across goroutines without additional synchronization.",{"type":15,"tag":28,"props":50,"children":52},{"id":51},"system-requirements",[53],{"type":21,"value":54},"System Requirements",{"type":15,"tag":23,"props":56,"children":57},{},[58],{"type":21,"value":59},"The SDK requires Go 1.21 or later. It uses Go modules for dependency management, the standard approach for modern Go projects.",{"type":15,"tag":28,"props":61,"children":63},{"id":62},"installation",[64],{"type":21,"value":65},"Installation",{"type":15,"tag":23,"props":67,"children":68},{},[69],{"type":21,"value":70},"Fetch the SDK using Go's module system. The package will be added to your go.mod file automatically:",{"type":15,"tag":72,"props":73,"children":77},"pre",{"className":74,"code":75,"language":76,"meta":7,"style":7},"language-bash shiki shiki-themes github-dark","go get github.com\u002Fcredvault\u002Fcredvault-edge-go\n","bash",[78],{"type":15,"tag":79,"props":80,"children":81},"code",{"__ignoreMap":7},[82],{"type":15,"tag":83,"props":84,"children":87},"span",{"class":85,"line":86},"line",1,[88,94,100],{"type":15,"tag":83,"props":89,"children":91},{"style":90},"--shiki-default:#B392F0",[92],{"type":21,"value":93},"go",{"type":15,"tag":83,"props":95,"children":97},{"style":96},"--shiki-default:#9ECBFF",[98],{"type":21,"value":99}," get",{"type":15,"tag":83,"props":101,"children":102},{"style":96},[103],{"type":21,"value":104}," github.com\u002Fcredvault\u002Fcredvault-edge-go\n",{"type":15,"tag":28,"props":106,"children":108},{"id":107},"connecting-to-credvault",[109],{"type":21,"value":110},"Connecting to CredVault",{"type":15,"tag":23,"props":112,"children":113},{},[114],{"type":21,"value":115},"Create a new client with your API key. The client struct contains resource fields for accessing different parts of the platform.",{"type":15,"tag":72,"props":117,"children":120},{"className":118,"code":119,"language":93,"meta":7,"style":7},"language-go shiki shiki-themes github-dark","package main\n\nimport (\n    \"os\"\n    \"github.com\u002Fcredvault\u002Fcredvault-edge-go\u002Fclient\"\n)\n\nfunc main() {\n    apiKey := os.Getenv(\"CREDVAULT_API_KEY\")\n    vault := credvault.New(apiKey)\n    \n    \u002F\u002F vault.Data...\n}\n",[121],{"type":15,"tag":79,"props":122,"children":123},{"__ignoreMap":7},[124,132,142,151,159,168,177,185,194,203,212,221,230],{"type":15,"tag":83,"props":125,"children":126},{"class":85,"line":86},[127],{"type":15,"tag":83,"props":128,"children":129},{},[130],{"type":21,"value":131},"package main\n",{"type":15,"tag":83,"props":133,"children":135},{"class":85,"line":134},2,[136],{"type":15,"tag":83,"props":137,"children":139},{"emptyLinePlaceholder":138},true,[140],{"type":21,"value":141},"\n",{"type":15,"tag":83,"props":143,"children":145},{"class":85,"line":144},3,[146],{"type":15,"tag":83,"props":147,"children":148},{},[149],{"type":21,"value":150},"import (\n",{"type":15,"tag":83,"props":152,"children":153},{"class":85,"line":10},[154],{"type":15,"tag":83,"props":155,"children":156},{},[157],{"type":21,"value":158},"    \"os\"\n",{"type":15,"tag":83,"props":160,"children":162},{"class":85,"line":161},5,[163],{"type":15,"tag":83,"props":164,"children":165},{},[166],{"type":21,"value":167},"    \"github.com\u002Fcredvault\u002Fcredvault-edge-go\u002Fclient\"\n",{"type":15,"tag":83,"props":169,"children":171},{"class":85,"line":170},6,[172],{"type":15,"tag":83,"props":173,"children":174},{},[175],{"type":21,"value":176},")\n",{"type":15,"tag":83,"props":178,"children":180},{"class":85,"line":179},7,[181],{"type":15,"tag":83,"props":182,"children":183},{"emptyLinePlaceholder":138},[184],{"type":21,"value":141},{"type":15,"tag":83,"props":186,"children":188},{"class":85,"line":187},8,[189],{"type":15,"tag":83,"props":190,"children":191},{},[192],{"type":21,"value":193},"func main() {\n",{"type":15,"tag":83,"props":195,"children":197},{"class":85,"line":196},9,[198],{"type":15,"tag":83,"props":199,"children":200},{},[201],{"type":21,"value":202},"    apiKey := os.Getenv(\"CREDVAULT_API_KEY\")\n",{"type":15,"tag":83,"props":204,"children":206},{"class":85,"line":205},10,[207],{"type":15,"tag":83,"props":208,"children":209},{},[210],{"type":21,"value":211},"    vault := credvault.New(apiKey)\n",{"type":15,"tag":83,"props":213,"children":215},{"class":85,"line":214},11,[216],{"type":15,"tag":83,"props":217,"children":218},{},[219],{"type":21,"value":220},"    \n",{"type":15,"tag":83,"props":222,"children":224},{"class":85,"line":223},12,[225],{"type":15,"tag":83,"props":226,"children":227},{},[228],{"type":21,"value":229},"    \u002F\u002F vault.Data...\n",{"type":15,"tag":83,"props":231,"children":233},{"class":85,"line":232},13,[234],{"type":15,"tag":83,"props":235,"children":236},{},[237],{"type":21,"value":238},"}\n",{"type":15,"tag":23,"props":240,"children":241},{},[242],{"type":21,"value":243},"For production applications, load your API key from an environment variable rather than hardcoding it. This keeps credentials secure and makes configuration flexible.",{"type":15,"tag":28,"props":245,"children":247},{"id":246},"working-with-data",[248],{"type":21,"value":249},"Working with Data",{"type":15,"tag":23,"props":251,"children":252},{},[253],{"type":21,"value":254},"All data operations return two values: a result and an error. Always check the error before using the result — this is the Go way.",{"type":15,"tag":23,"props":256,"children":257},{},[258,264],{"type":15,"tag":259,"props":260,"children":261},"strong",{},[262],{"type":21,"value":263},"Listing clusters",{"type":21,"value":265}," returns a slice of cluster information. Iterate over the results to find the cluster you need.",{"type":15,"tag":23,"props":267,"children":268},{},[269,274],{"type":15,"tag":259,"props":270,"children":271},{},[272],{"type":21,"value":273},"Querying collections",{"type":21,"value":275}," fetches documents matching your criteria. Pass query parameters as a map and receive matching documents in response.",{"type":15,"tag":23,"props":277,"children":278},{},[279,284],{"type":15,"tag":259,"props":280,"children":281},{},[282],{"type":21,"value":283},"Inserting documents",{"type":21,"value":285}," adds new records. Prepare your data as slice of maps and insert them in one call.",{"type":15,"tag":23,"props":287,"children":288},{},[289,294],{"type":15,"tag":259,"props":290,"children":291},{},[292],{"type":21,"value":293},"Updating and deleting",{"type":21,"value":295}," follow similar patterns. Specify filters and receive confirmation of the operation's effect.",{"type":15,"tag":28,"props":297,"children":299},{"id":298},"error-handling",[300],{"type":21,"value":301},"Error Handling",{"type":15,"tag":23,"props":303,"children":304},{},[305],{"type":21,"value":306},"Every SDK method returns an error value. Always check errors before proceeding:",{"type":15,"tag":23,"props":308,"children":309},{},[310],{"type":21,"value":311},"The error value contains details about what went wrong. For network errors, consider implementing retry logic with backoff. For authentication errors, check your credentials. For not-found errors, verify the resource exists.",{"type":15,"tag":28,"props":313,"children":315},{"id":314},"resources-available",[316],{"type":21,"value":317},"Resources Available",{"type":15,"tag":23,"props":319,"children":320},{},[321],{"type":21,"value":322},"The client provides access to all platform capabilities through typed structs:",{"type":15,"tag":324,"props":325,"children":326},"ul",{},[327,338,348,358,368,378,388,398,408,418,428,438,448],{"type":15,"tag":328,"props":329,"children":330},"li",{},[331,336],{"type":15,"tag":259,"props":332,"children":333},{},[334],{"type":21,"value":335},"Auth",{"type":21,"value":337}," — User authentication",{"type":15,"tag":328,"props":339,"children":340},{},[341,346],{"type":15,"tag":259,"props":342,"children":343},{},[344],{"type":21,"value":345},"Data",{"type":21,"value":347}," — Database operations",{"type":15,"tag":328,"props":349,"children":350},{},[351,356],{"type":15,"tag":259,"props":352,"children":353},{},[354],{"type":21,"value":355},"Cie",{"type":21,"value":357}," — Intelligence Engine",{"type":15,"tag":328,"props":359,"children":360},{},[361,366],{"type":15,"tag":259,"props":362,"children":363},{},[364],{"type":21,"value":365},"Webhooks",{"type":21,"value":367}," — Event notifications",{"type":15,"tag":328,"props":369,"children":370},{},[371,376],{"type":15,"tag":259,"props":372,"children":373},{},[374],{"type":21,"value":375},"Functions",{"type":21,"value":377}," — Serverless execution",{"type":15,"tag":328,"props":379,"children":380},{},[381,386],{"type":15,"tag":259,"props":382,"children":383},{},[384],{"type":21,"value":385},"Triggers",{"type":21,"value":387}," — Event automation",{"type":15,"tag":328,"props":389,"children":390},{},[391,396],{"type":15,"tag":259,"props":392,"children":393},{},[394],{"type":21,"value":395},"Backups",{"type":21,"value":397}," — Data protection",{"type":15,"tag":328,"props":399,"children":400},{},[401,406],{"type":15,"tag":259,"props":402,"children":403},{},[404],{"type":21,"value":405},"Schema",{"type":21,"value":407}," — Index management",{"type":15,"tag":328,"props":409,"children":410},{},[411,416],{"type":15,"tag":259,"props":412,"children":413},{},[414],{"type":21,"value":415},"ApiKeys",{"type":21,"value":417}," — Key lifecycle",{"type":15,"tag":328,"props":419,"children":420},{},[421,426],{"type":15,"tag":259,"props":422,"children":423},{},[424],{"type":21,"value":425},"Metrics",{"type":21,"value":427}," — Monitoring",{"type":15,"tag":328,"props":429,"children":430},{},[431,436],{"type":15,"tag":259,"props":432,"children":433},{},[434],{"type":21,"value":435},"Logs",{"type":21,"value":437}," — Activity logs",{"type":15,"tag":328,"props":439,"children":440},{},[441,446],{"type":15,"tag":259,"props":442,"children":443},{},[444],{"type":21,"value":445},"Notifications",{"type":21,"value":447}," — User notifications",{"type":15,"tag":328,"props":449,"children":450},{},[451,456],{"type":15,"tag":259,"props":452,"children":453},{},[454],{"type":21,"value":455},"Settings",{"type":21,"value":457}," — Configuration",{"type":15,"tag":23,"props":459,"children":460},{},[461],{"type":21,"value":462},"Each resource is accessed through the corresponding field on the client struct.",{"type":15,"tag":28,"props":464,"children":466},{"id":465},"concurrency",[467],{"type":21,"value":468},"Concurrency",{"type":15,"tag":23,"props":470,"children":471},{},[472],{"type":21,"value":473},"Go applications often run many operations concurrently. The CredVault client is safe for concurrent use — share a single client across goroutines.",{"type":15,"tag":23,"props":475,"children":476},{},[477],{"type":21,"value":478},"For bulk operations, consider using goroutines with WaitGroups to parallelize work. The client handles connection pooling internally.",{"type":15,"tag":28,"props":480,"children":482},{"id":481},"context-support",[483],{"type":21,"value":484},"Context Support",{"type":15,"tag":23,"props":486,"children":487},{},[488],{"type":21,"value":489},"For advanced use cases, operations support context for cancellation and timeouts. Pass a context to control request lifecycle and implement graceful shutdown.",{"type":15,"tag":28,"props":491,"children":493},{"id":492},"best-practices",[494],{"type":21,"value":495},"Best Practices",{"type":15,"tag":23,"props":497,"children":498},{},[499,504],{"type":15,"tag":259,"props":500,"children":501},{},[502],{"type":21,"value":503},"Create one client, reuse it.",{"type":21,"value":505}," The client maintains connection pools and authentication state. Creating new clients for every request wastes resources.",{"type":15,"tag":23,"props":507,"children":508},{},[509,514],{"type":15,"tag":259,"props":510,"children":511},{},[512],{"type":21,"value":513},"Always handle errors.",{"type":21,"value":515}," Never discard error returns. Log them, report them to monitoring, and handle them appropriately.",{"type":15,"tag":23,"props":517,"children":518},{},[519,524],{"type":15,"tag":259,"props":520,"children":521},{},[522],{"type":21,"value":523},"Use environment variables for configuration.",{"type":21,"value":525}," Keep API keys out of source code. Use os.Getenv or a configuration library.",{"type":15,"tag":23,"props":527,"children":528},{},[529,534],{"type":15,"tag":259,"props":530,"children":531},{},[532],{"type":21,"value":533},"Implement graceful shutdown.",{"type":21,"value":535}," When your application terminates, give in-flight requests time to complete.",{"type":15,"tag":23,"props":537,"children":538},{},[539],{"type":21,"value":540},"For implementation details and additional examples, refer to the SDK's README on GitHub or explore the source code.",{"type":15,"tag":542,"props":543,"children":544},"style",{},[545],{"type":21,"value":546},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":134,"depth":134,"links":548},[549,550,551,552,553,554,555,556,557,558],{"id":30,"depth":134,"text":33},{"id":51,"depth":134,"text":54},{"id":62,"depth":134,"text":65},{"id":107,"depth":134,"text":110},{"id":246,"depth":134,"text":249},{"id":298,"depth":134,"text":301},{"id":314,"depth":134,"text":317},{"id":465,"depth":134,"text":468},{"id":481,"depth":134,"text":484},{"id":492,"depth":134,"text":495},"markdown","content:docs:sdks:go.md","content","docs\u002Fsdks\u002Fgo.md","docs\u002Fsdks\u002Fgo","md",1782233754804]