no bindings for interface return types #4304
Unanswered
nasoooor29
asked this question in
Q&A
Replies: 2 comments 3 replies
-
this is a replicate setup
app.go package main
import (
"context"
)
// App struct
type App struct {
ctx context.Context
Sites []Fetcher
}
func (a *App) GetSites() []Fetcher { // error will be here but in ts
return a.Sites
}
type Episode struct {
Index int
Name string
URL string
}
type FetchManager struct {
Sites []Fetcher
}
type Fetcher interface {
SearchSeries(query string) (Episode, error)
Downloader
}
type Downloader interface {
DownloadEpisode(ep *Episode, path string) error
}
type Site1 struct{}
type Site2 struct{}
func (s *Site1) SearchSeries(query string) (Episode, error) {
return Episode{}, nil
}
func (s *Site1) DownloadEpisode(ep *Episode, path string) error {
return nil
}
func (s *Site2) SearchSeries(query string) (Episode, error) {
return Episode{}, nil
}
func (s *Site2) DownloadEpisode(ep *Episode, path string) error {
return nil
}
// NewApp creates a new App application struct
func NewApp() *App {
return &App{
Sites: []Fetcher{
&Site1{},
&Site2{},
},
}
}
// startup is called when the app starts. The context is saved
// so we can call the runtime methods
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
another note
although i don't mind alot changing my app architechture but i prefer not to change it too much, or maybe im doing something wrong, i want someone to tell me how to do it the "wails" way |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
i have a method that return an interface
the bindings generated
everything is good except the Fetcher interface is not generated on
i had the same issue with enums but it was solved with from the docs
the Fetcher interface is not generated with the bindings, i tried to find a way from the docs but couldn't find it
Beta Was this translation helpful? Give feedback.
All reactions