@@ -2051,31 +2051,31 @@ func GeoLookup(ip net.IP) ([]byte, error) {
20512051
20522052// witx:
20532053//
2054- // (module $fastly_object_store
2054+ // (module $fastly_kv_store
20552055// (@interface func (export "open")
20562056// (param $name string)
2057- // (result $err (expected $object_store_handle (error $fastly_status)))
2057+ // (result $err (expected $kv_store_handle (error $fastly_status)))
20582058// )
20592059
2060- //go:wasm-module fastly_object_store
2060+ //go:wasm-module fastly_kv_store
20612061//export open
20622062//go:noescape
2063- func fastlyObjectStoreOpen (
2063+ func fastlyKVStoreOpen (
20642064 name prim.Wstring ,
2065- h * objectStoreHandle ,
2065+ h * kvStoreHandle ,
20662066) FastlyStatus
20672067
2068- // ObjectStore represents a Fastly object store, a collection of key/value pairs.
2068+ // KVStore represents a Fastly kv store, a collection of key/value pairs.
20692069// For convenience, keys and values are both modelled as Go strings.
2070- type ObjectStore struct {
2071- h objectStoreHandle
2070+ type KVStore struct {
2071+ h kvStoreHandle
20722072}
20732073
2074- // ObjectStoreOpen returns a reference to the named object store, if it exists.
2075- func OpenObjectStore (name string ) (* ObjectStore , error ) {
2076- var o ObjectStore
2074+ // KVStoreOpen returns a reference to the named kv store, if it exists.
2075+ func OpenKVStore (name string ) (* KVStore , error ) {
2076+ var o KVStore
20772077
2078- if err := fastlyObjectStoreOpen (
2078+ if err := fastlyKVStoreOpen (
20792079 prim .NewReadBufferFromString (name ).Wstring (),
20802080 & o .h ,
20812081 ).toError (); err != nil {
@@ -2088,26 +2088,26 @@ func OpenObjectStore(name string) (*ObjectStore, error) {
20882088// witx:
20892089//
20902090// (@interface func (export "lookup")
2091- // (param $store $object_store_handle )
2091+ // (param $store $kv_store_handle )
20922092// (param $key string)
20932093// (param $body_handle_out (@witx pointer $body_handle))
20942094// (result $err (expected (error $fastly_status)))
20952095// )
20962096
2097- //go:wasm-module fastly_object_store
2097+ //go:wasm-module fastly_kv_store
20982098//export lookup
20992099//go:noescape
2100- func fastlyObjectStoreLookup (
2101- h objectStoreHandle ,
2100+ func fastlyKVStoreLookup (
2101+ h kvStoreHandle ,
21022102 key prim.Wstring ,
21032103 b * bodyHandle ,
21042104) FastlyStatus
21052105
21062106// Lookup returns the value for key, if it exists.
2107- func (o * ObjectStore ) Lookup (key string ) (io.Reader , error ) {
2107+ func (o * KVStore ) Lookup (key string ) (io.Reader , error ) {
21082108 body := HTTPBody {h : invalidBodyHandle }
21092109
2110- if err := fastlyObjectStoreLookup (
2110+ if err := fastlyKVStoreLookup (
21112111 o .h ,
21122112 prim .NewReadBufferFromString (key ).Wstring (),
21132113 & body .h ,
@@ -2127,23 +2127,23 @@ func (o *ObjectStore) Lookup(key string) (io.Reader, error) {
21272127// witx:
21282128//
21292129// (@interface func (export "insert")
2130- // (param $store $object_store_handle )
2130+ // (param $store $kv_store_handle )
21312131// (param $key string)
21322132// (param $body_handle $body_handle)
21332133// (result $err (expected (error $fastly_status)))
21342134// )
21352135
2136- //go:wasm-module fastly_object_store
2136+ //go:wasm-module fastly_kv_store
21372137//export insert
21382138//go:noescape
2139- func fastlyObjectStoreInsert (
2140- h objectStoreHandle ,
2139+ func fastlyKVStoreInsert (
2140+ h kvStoreHandle ,
21412141 key prim.Wstring ,
21422142 b bodyHandle ,
21432143) FastlyStatus
21442144
2145- // Insert adds a key/value pair to the object store.
2146- func (o * ObjectStore ) Insert (key string , value io.Reader ) error {
2145+ // Insert adds a key/value pair to the kv store.
2146+ func (o * KVStore ) Insert (key string , value io.Reader ) error {
21472147 body , err := NewHTTPBody ()
21482148 if err != nil {
21492149 return err
@@ -2153,7 +2153,7 @@ func (o *ObjectStore) Insert(key string, value io.Reader) error {
21532153 return err
21542154 }
21552155
2156- if err := fastlyObjectStoreInsert (
2156+ if err := fastlyKVStoreInsert (
21572157 o .h ,
21582158 prim .NewReadBufferFromString (key ).Wstring (),
21592159 body .h ,
0 commit comments