docs: add Go external storage snipsync snippets#804
Conversation
Add Go snippet files for external storage documentation alongside the existing Python snippets. Covers S3 driver setup, custom storage driver, threshold configuration, and multiple driver selection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| "go.temporal.io/sdk/converter" | ||
| ) | ||
|
|
||
| func ThresholdConfig(driver converter.StorageDriver) { |
There was a problem hiding this comment.
Is it not expected that these functions are called/tested in this repo?
There was a problem hiding this comment.
I don't think the snippet bar is "called/tested" but "does it compile"?
- Remove unnecessary awss3 import alias - Return converter.StorageDriver interface from constructor - Fix PayloadSizeThreshold minimum from 0 to 1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| storeDir string | ||
| } | ||
|
|
||
| func NewLocalDiskStorageDriver(storeDir string) *LocalDiskStorageDriver { |
There was a problem hiding this comment.
| func NewLocalDiskStorageDriver(storeDir string) *LocalDiskStorageDriver { | |
| func NewLocalDiskStorageDriver(storeDir string) StorageDriver { |
| payloads []*commonpb.Payload, | ||
| ) ([]converter.StorageDriverClaim, error) { | ||
| dir := d.storeDir | ||
| if info, ok := ctx.Target.(converter.StorageDriverWorkflowInfo); ok && info.WorkflowID != "" { |
There was a problem hiding this comment.
I'd add another one for StorageDriverActivityInfo that pulls out the activity ID and namespace and appends similarly.
There was a problem hiding this comment.
This is only for standalone activities right?
| } | ||
| return payloads, nil | ||
| } | ||
|
|
There was a problem hiding this comment.
nit: Should the snipend be right after the closing brackets to minimize whitespace in the code blocks? Apply decision to all files.
features/snippets/external_storage/s3_setup/s3_driver_create.go
Outdated
Show resolved
Hide resolved
| "go.temporal.io/sdk/converter" | ||
| ) | ||
|
|
||
| func ThresholdConfig(driver converter.StorageDriver) { |
There was a problem hiding this comment.
I don't think the snippet bar is "called/tested" but "does it compile"?
- Add StorageDriverActivityInfo handling in custom driver - Remove blank lines before SNIPEND markers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Test plan
go build ./snippets/external_storage/...passes🤖 Generated with Claude Code