From 4eccdb657625953b80ef43fa91819e4553f24fb7 Mon Sep 17 00:00:00 2001 From: yyyoichi Date: Thu, 30 Apr 2026 08:27:52 +0900 Subject: [PATCH] add IfGenerationMatch to KVStoreInsertConfig Co-authored-by: Copilot --- kvstore/kvstore.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kvstore/kvstore.go b/kvstore/kvstore.go index acc2b9d..4c5a000 100644 --- a/kvstore/kvstore.go +++ b/kvstore/kvstore.go @@ -151,10 +151,11 @@ const ( ) type InsertConfig struct { - Mode InsertMode - BackgroundFetch bool - Metadata []byte - TTLSec uint32 + Mode InsertMode + BackgroundFetch bool + Metadata []byte + TTLSec uint32 + IfGenerationMatch uint64 } // Insert adds a key to the associated KV store. @@ -171,6 +172,9 @@ func (s *Store) InsertWithConfig(key string, value io.Reader, config *InsertConf if config.TTLSec != 0 { abiConf.TTLSec(config.TTLSec) } + if config.IfGenerationMatch != 0 { + abiConf.IfGenerationMatch(config.IfGenerationMatch) + } } var body *fastly.HTTPBody