@@ -2051,31 +2051,31 @@ func GeoLookup(ip net.IP) ([]byte, error) {
2051
2051
2052
2052
// witx:
2053
2053
//
2054
- // (module $fastly_object_store
2054
+ // (module $fastly_kv_store
2055
2055
// (@interface func (export "open")
2056
2056
// (param $name string)
2057
- // (result $err (expected $object_store_handle (error $fastly_status)))
2057
+ // (result $err (expected $kv_store_handle (error $fastly_status)))
2058
2058
// )
2059
2059
2060
- //go:wasm-module fastly_object_store
2060
+ //go:wasm-module fastly_kv_store
2061
2061
//export open
2062
2062
//go:noescape
2063
- func fastlyObjectStoreOpen (
2063
+ func fastlyKVStoreOpen (
2064
2064
name prim.Wstring ,
2065
- h * objectStoreHandle ,
2065
+ h * kvStoreHandle ,
2066
2066
) FastlyStatus
2067
2067
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.
2069
2069
// 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
2072
2072
}
2073
2073
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
2077
2077
2078
- if err := fastlyObjectStoreOpen (
2078
+ if err := fastlyKVStoreOpen (
2079
2079
prim .NewReadBufferFromString (name ).Wstring (),
2080
2080
& o .h ,
2081
2081
).toError (); err != nil {
@@ -2088,26 +2088,26 @@ func OpenObjectStore(name string) (*ObjectStore, error) {
2088
2088
// witx:
2089
2089
//
2090
2090
// (@interface func (export "lookup")
2091
- // (param $store $object_store_handle )
2091
+ // (param $store $kv_store_handle )
2092
2092
// (param $key string)
2093
2093
// (param $body_handle_out (@witx pointer $body_handle))
2094
2094
// (result $err (expected (error $fastly_status)))
2095
2095
// )
2096
2096
2097
- //go:wasm-module fastly_object_store
2097
+ //go:wasm-module fastly_kv_store
2098
2098
//export lookup
2099
2099
//go:noescape
2100
- func fastlyObjectStoreLookup (
2101
- h objectStoreHandle ,
2100
+ func fastlyKVStoreLookup (
2101
+ h kvStoreHandle ,
2102
2102
key prim.Wstring ,
2103
2103
b * bodyHandle ,
2104
2104
) FastlyStatus
2105
2105
2106
2106
// 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 ) {
2108
2108
body := HTTPBody {h : invalidBodyHandle }
2109
2109
2110
- if err := fastlyObjectStoreLookup (
2110
+ if err := fastlyKVStoreLookup (
2111
2111
o .h ,
2112
2112
prim .NewReadBufferFromString (key ).Wstring (),
2113
2113
& body .h ,
@@ -2127,23 +2127,23 @@ func (o *ObjectStore) Lookup(key string) (io.Reader, error) {
2127
2127
// witx:
2128
2128
//
2129
2129
// (@interface func (export "insert")
2130
- // (param $store $object_store_handle )
2130
+ // (param $store $kv_store_handle )
2131
2131
// (param $key string)
2132
2132
// (param $body_handle $body_handle)
2133
2133
// (result $err (expected (error $fastly_status)))
2134
2134
// )
2135
2135
2136
- //go:wasm-module fastly_object_store
2136
+ //go:wasm-module fastly_kv_store
2137
2137
//export insert
2138
2138
//go:noescape
2139
- func fastlyObjectStoreInsert (
2140
- h objectStoreHandle ,
2139
+ func fastlyKVStoreInsert (
2140
+ h kvStoreHandle ,
2141
2141
key prim.Wstring ,
2142
2142
b bodyHandle ,
2143
2143
) FastlyStatus
2144
2144
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 {
2147
2147
body , err := NewHTTPBody ()
2148
2148
if err != nil {
2149
2149
return err
@@ -2153,7 +2153,7 @@ func (o *ObjectStore) Insert(key string, value io.Reader) error {
2153
2153
return err
2154
2154
}
2155
2155
2156
- if err := fastlyObjectStoreInsert (
2156
+ if err := fastlyKVStoreInsert (
2157
2157
o .h ,
2158
2158
prim .NewReadBufferFromString (key ).Wstring (),
2159
2159
body .h ,
0 commit comments