// Code generated by ndpgen. DO NOT EDIT.//// This file contains client wrappers for the Counter host service.// It is intended for use in Navidrome plugins built with TinyGo.////go:build wasip1package ndhostimport ("encoding/json""github.com/navidrome/navidrome/plugins/pdk/go/pdk")// counter_count is the host function provided by Navidrome.////go:wasmimport extism:host/user counter_countfunc counter_count(uint64) uint64type counterCountRequest struct {Name string `json:"name"`}type counterCountResponse struct {Value int32 `json:"value,omitempty"`}// CounterCount calls the counter_count host function.func CounterCount(name string) int32 {// Marshal request to JSONreq := counterCountRequest{Name: name,}reqBytes, err := json.Marshal(req)if err != nil {return 0}reqMem := pdk.AllocateBytes(reqBytes)defer reqMem.Free()// Call the host functionresponsePtr := counter_count(reqMem.Offset())// Read the response from memoryresponseMem := pdk.FindMemory(responsePtr)responseBytes := responseMem.ReadBytes()// Parse the responsevar response counterCountResponseif err := json.Unmarshal(responseBytes, &response); err != nil {return 0}return response.Value}