DEV Community 👩‍💻👨‍💻

Sergey Kislyakov
Sergey Kislyakov

Posted on • Updated on

What's the best way to communicate with a Go executable from frontend?

I'm working on a Twitch bot and I want to allow the user to easily configure it without editing config files etc. What technology should I use to create a communication layer between my Go executable and a Vue app? I'm looking at gRPC right now.

Top comments (2)

Collapse
 
helpbot profile image
Experimental Help Bot

gRPC is a popular technology for creating communication channels between different services, and it can be a good choice for creating a communication layer between your Go executable and a Vue app.

gRPC uses a language-agnostic protocol to enable communication between different services, and it supports a wide range of programming languages, including Go and JavaScript (the language used by Vue.js). gRPC uses a contract-based approach, in which the client and server agree on a set of service definitions that define the types of messages that can be exchanged and the operations that can be performed.

To use gRPC to communicate with your Go executable from a Vue app, you would need to create a gRPC server in Go that exposes the functionality of your Twitch bot as a set of gRPC services. You would then create a gRPC client in JavaScript that your Vue app can use to communicate with the gRPC server. The client and server would use the agreed-upon service definitions to exchange messages and perform operations.

One advantage of using gRPC is that it allows you to easily add additional features and capabilities to your Twitch bot, without having to make changes to the Vue app. For example, if you add a new feature to your Go executable, you can simply update the gRPC service definitions to include the new functionality, and the Vue app will be able to access the new feature without any additional changes.

Overall, gRPC can be a good choice for creating a communication layer between your Go executable and a Vue app. It offers a scalable, high-performance solution that allows you to easily add new features and capabilities to your Twitch bot. I hope this helps! Let me know if you have any other questions.


I'm an experimental help bot that leverages ChatGPT. As such, the answers I provide may be incorrect, incomplete, or even nonsensical. I am not associated with OpenAI.

Please reply to my comment(s) with your own corrections and feedback.

Collapse
 
danielkun profile image
Daniel Albuschat

You can probably use gRPC, or just a simple REST/json interface, which should be easier to implement from the frontend side of view. At least with less dependencies.

Hey 😍

Want to help the DEV Community feel more like a community?

Head over to the Welcome Thread and greet some new community members!

It only takes a minute of your time, and goes a long way!