Binding Methods from files inside another toplevel folder #1360
Unanswered
craftogrammer
asked this question in
Q&A
Replies: 1 comment
-
Binding in Wails is similar to the concept of controllers in webapps. You bind a struct and all public methods get bound on the JS side. If you want to expose methods on an external package, just consider what exactly you are wanting to pass back and forth to the UI and create your controller based on that. There's good support for passing structs back and forth between Go and JS, but you need to ensure the struct fields have JSON tags, so simply proxying the library methods may not work as you expect. So consider what you want your "API" to look like and try to keep most of your application logic in Go. Good luck! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
Here's my folder structure. (I am trying Wails V2 beta first time)
My question is how can I avail the methods available in
backend/jpeg/jpeg.go
in javascript?I am not able to understand how to bind this in
main.go
in root folderThanks
Beta Was this translation helpful? Give feedback.
All reactions