diff --git a/plugins/cmd/hostgen/internal/generator.go b/plugins/cmd/hostgen/internal/generator.go index 5810f6349..e10c30ef8 100644 --- a/plugins/cmd/hostgen/internal/generator.go +++ b/plugins/cmd/hostgen/internal/generator.go @@ -84,12 +84,6 @@ func GenerateHost(svc Service, pkgName string) ([]byte, error) { return buf.Bytes(), nil } -// GenerateService generates the host function wrapper code for a service. -// Deprecated: Use GenerateHost instead. -func GenerateService(svc Service, pkgName string) ([]byte, error) { - return GenerateHost(svc, pkgName) -} - // GenerateClientGo generates client wrapper code for plugins to call host functions. func GenerateClientGo(svc Service) ([]byte, error) { tmplContent, err := templatesFS.ReadFile("templates/client_go.go.tmpl") diff --git a/plugins/cmd/hostgen/internal/generator_test.go b/plugins/cmd/hostgen/internal/generator_test.go index d3934fec9..8ec9c0902 100644 --- a/plugins/cmd/hostgen/internal/generator_test.go +++ b/plugins/cmd/hostgen/internal/generator_test.go @@ -9,7 +9,7 @@ import ( ) var _ = Describe("Generator", func() { - Describe("GenerateService", func() { + Describe("GenerateHost", func() { It("should generate valid Go code for a simple service with strings", func() { // String params/returns don't need JSON - they use direct memory read/write svc := Service{ @@ -26,7 +26,7 @@ var _ = Describe("Generator", func() { }, } - code, err := GenerateService(svc, "host") + code, err := GenerateHost(svc, "host") Expect(err).NotTo(HaveOccurred()) // Verify the code is valid Go @@ -73,7 +73,7 @@ var _ = Describe("Generator", func() { }, } - code, err := GenerateService(svc, "host") + code, err := GenerateHost(svc, "host") Expect(err).NotTo(HaveOccurred()) _, err = format.Source(code) @@ -98,7 +98,7 @@ var _ = Describe("Generator", func() { }, } - code, err := GenerateService(svc, "host") + code, err := GenerateHost(svc, "host") Expect(err).NotTo(HaveOccurred()) _, err = format.Source(code) @@ -132,7 +132,7 @@ var _ = Describe("Generator", func() { }, } - code, err := GenerateService(svc, "host") + code, err := GenerateHost(svc, "host") Expect(err).NotTo(HaveOccurred()) _, err = format.Source(code) @@ -164,7 +164,7 @@ var _ = Describe("Generator", func() { }, } - code, err := GenerateService(svc, "host") + code, err := GenerateHost(svc, "host") Expect(err).NotTo(HaveOccurred()) _, err = format.Source(code) @@ -200,7 +200,7 @@ var _ = Describe("Generator", func() { }, } - code, err := GenerateService(svc, "host") + code, err := GenerateHost(svc, "host") Expect(err).NotTo(HaveOccurred()) _, err = format.Source(code) @@ -229,7 +229,7 @@ var _ = Describe("Generator", func() { }, } - code, err := GenerateService(svc, "host") + code, err := GenerateHost(svc, "host") Expect(err).NotTo(HaveOccurred()) codeStr := string(code) @@ -254,7 +254,7 @@ var _ = Describe("Generator", func() { }, } - code, err := GenerateService(svc, "host") + code, err := GenerateHost(svc, "host") Expect(err).NotTo(HaveOccurred()) codeStr := string(code) @@ -278,7 +278,7 @@ var _ = Describe("Generator", func() { }, } - code, err := GenerateService(svc, "host") + code, err := GenerateHost(svc, "host") Expect(err).NotTo(HaveOccurred()) codeStr := string(code) @@ -336,7 +336,7 @@ type TestService interface { Expect(services).To(HaveLen(1)) // Generate - code, err := GenerateService(services[0], "host") + code, err := GenerateHost(services[0], "host") Expect(err).NotTo(HaveOccurred()) // Format (validates syntax) diff --git a/plugins/cmd/hostgen/internal/templates/client_go.go.tmpl b/plugins/cmd/hostgen/internal/templates/client_go.go.tmpl index 520113fd5..dcf7767f0 100644 --- a/plugins/cmd/hostgen/internal/templates/client_go.go.tmpl +++ b/plugins/cmd/hostgen/internal/templates/client_go.go.tmpl @@ -2,6 +2,8 @@ // // This file contains client wrappers for the {{.Service.Name}} host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/cmd/hostgen/testdata/codec_client_expected.go b/plugins/cmd/hostgen/testdata/codec_client_expected.go index b050070df..da2779d7c 100644 --- a/plugins/cmd/hostgen/testdata/codec_client_expected.go +++ b/plugins/cmd/hostgen/testdata/codec_client_expected.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the Codec host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/cmd/hostgen/testdata/counter_client_expected.go b/plugins/cmd/hostgen/testdata/counter_client_expected.go index 8aa15f560..d931cfe10 100644 --- a/plugins/cmd/hostgen/testdata/counter_client_expected.go +++ b/plugins/cmd/hostgen/testdata/counter_client_expected.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the Counter host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/cmd/hostgen/testdata/echo_client_expected.go b/plugins/cmd/hostgen/testdata/echo_client_expected.go index 876d00ac7..b7adb2d8d 100644 --- a/plugins/cmd/hostgen/testdata/echo_client_expected.go +++ b/plugins/cmd/hostgen/testdata/echo_client_expected.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the Echo host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/cmd/hostgen/testdata/list_client_expected.go b/plugins/cmd/hostgen/testdata/list_client_expected.go index 7f22abf59..d5e301244 100644 --- a/plugins/cmd/hostgen/testdata/list_client_expected.go +++ b/plugins/cmd/hostgen/testdata/list_client_expected.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the List host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/cmd/hostgen/testdata/math_client_expected.go b/plugins/cmd/hostgen/testdata/math_client_expected.go index f26e6f567..6710d1f10 100644 --- a/plugins/cmd/hostgen/testdata/math_client_expected.go +++ b/plugins/cmd/hostgen/testdata/math_client_expected.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the Math host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/cmd/hostgen/testdata/meta_client_expected.go b/plugins/cmd/hostgen/testdata/meta_client_expected.go index 9d97fa92e..fa14bf7ec 100644 --- a/plugins/cmd/hostgen/testdata/meta_client_expected.go +++ b/plugins/cmd/hostgen/testdata/meta_client_expected.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the Meta host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/cmd/hostgen/testdata/ping_client_expected.go b/plugins/cmd/hostgen/testdata/ping_client_expected.go index 1215827e8..e352dff73 100644 --- a/plugins/cmd/hostgen/testdata/ping_client_expected.go +++ b/plugins/cmd/hostgen/testdata/ping_client_expected.go @@ -2,6 +2,8 @@ // // 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 diff --git a/plugins/cmd/hostgen/testdata/search_client_expected.go b/plugins/cmd/hostgen/testdata/search_client_expected.go index 20a00b941..877665567 100644 --- a/plugins/cmd/hostgen/testdata/search_client_expected.go +++ b/plugins/cmd/hostgen/testdata/search_client_expected.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the Search host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/cmd/hostgen/testdata/store_client_expected.go b/plugins/cmd/hostgen/testdata/store_client_expected.go index 773de3f77..de873919a 100644 --- a/plugins/cmd/hostgen/testdata/store_client_expected.go +++ b/plugins/cmd/hostgen/testdata/store_client_expected.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the Store host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/cmd/hostgen/testdata/users_client_expected.go b/plugins/cmd/hostgen/testdata/users_client_expected.go index cfa688ff0..730f460ba 100644 --- a/plugins/cmd/hostgen/testdata/users_client_expected.go +++ b/plugins/cmd/hostgen/testdata/users_client_expected.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the Users host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/host/go/nd_host_scheduler.go b/plugins/host/go/nd_host_scheduler.go index 580874b32..4083160b9 100644 --- a/plugins/host/go/nd_host_scheduler.go +++ b/plugins/host/go/nd_host_scheduler.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the Scheduler host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main diff --git a/plugins/host/go/nd_host_subsonicapi.go b/plugins/host/go/nd_host_subsonicapi.go index 30846a496..ea1de838d 100644 --- a/plugins/host/go/nd_host_subsonicapi.go +++ b/plugins/host/go/nd_host_subsonicapi.go @@ -2,6 +2,8 @@ // // This file contains client wrappers for the SubsonicAPI host service. // It is intended for use in Navidrome plugins built with TinyGo. +// +//go:build wasip1 package main