// Code generated by ndpgen. DO NOT EDIT.//// This file contains client wrappers for the Echo host service.// It is intended for use in Navidrome plugins built with TinyGo.////go:build wasip1package ndhostimport ("encoding/json""errors""github.com/navidrome/navidrome/plugins/pdk/go/pdk")// echo_echo is the host function provided by Navidrome.////go:wasmimport extism:host/user echo_echofunc echo_echo(uint64) uint64type echoEchoRequest struct {Message string `json:"message"`}type echoEchoResponse struct {Reply string `json:"reply,omitempty"`Error string `json:"error,omitempty"`}// EchoEcho calls the echo_echo host function.func EchoEcho(message string) (string, error) {// Marshal request to JSONreq := echoEchoRequest{Message: message,}reqBytes, err := json.Marshal(req)if err != nil {return "", err}reqMem := pdk.AllocateBytes(reqBytes)defer reqMem.Free()// Call the host functionresponsePtr := echo_echo(reqMem.Offset())// Read the response from memoryresponseMem := pdk.FindMemory(responsePtr)responseBytes := responseMem.ReadBytes()// Parse the responsevar response echoEchoResponseif err := json.Unmarshal(responseBytes, &response); err != nil {return "", err}// Convert Error field to Go errorif response.Error != "" {return "", errors.New(response.Error)}return response.Reply, nil}