navidrome/plugins/cmd/hostgen/testdata/ping_client_expected.go
2025-12-31 17:06:29 -05:00

37 lines
707 B
Go

// Code generated by hostgen. DO NOT EDIT.
//
// This file contains client wrappers for the Ping host service.
// It is intended for use in Navidrome plugins built with TinyGo.
//
//go:build wasip1
package main
import (
"errors"
"github.com/extism/go-pdk"
)
// ping_ping is the host function provided by Navidrome.
//
//go:wasmimport extism:host/user ping_ping
func ping_ping() uint64
// PingPing calls the ping_ping host function.
func PingPing() error {
// Call the host function
responsePtr := ping_ping()
// Read the response from memory
responseMem := pdk.FindMemory(responsePtr)
errStr := string(responseMem.ReadBytes())
if errStr != "" {
return errors.New(errStr)
}
return nil
}