(ctx context.Context, id int64, item *Item)
| 127 | } |
| 128 | |
| 129 | func (e *Example) Set(ctx context.Context, id int64, item *Item) error { |
| 130 | // enable write to new storage |
| 131 | // ... |
| 132 | if err := e.storeV1.Set(ctx, id, item); err != nil { |
| 133 | return fmt.Errorf("failed to store item: %w", err) |
| 134 | } |
| 135 | return nil |
| 136 | } |
| 137 | |
| 138 | func (e *Example) Get(ctx context.Context, id int64) (*Item, error) { |
| 139 | // 1. enable shadow read from new storage |