How to embed fluxlang into your own Go service

Hi,

I was wondering if it is a valid use case to embed Fluxlang into your own separate Go service. I am thinking of building new service speaking Fluxlang and for this I would need to embed it. I had a look at GitHub but could not find any examples of how to embed the language besides of the original flux commands.

Cheers,

Paul

Hello @snonux,
Welcome!
I’m not sure. I’m asking around.

Hi, if you want to embed Flux into your own Go service, you can take a look at InfluxDB and see how it does it. In general, the only part that is a bit strange is that we use this utility to compile and link in the Rust components of Flux.

Some links to the integration in InfluxDB:

This will hopefully get you started. The flux cli program is probably a bad place to start because it uses the REPL and the REPL isn’t really something that you want to include in an embedded service.

Also, just note that the flux library itself if at v0 so it’s possible we will break Go APIs. We generally try not to because it makes maintaining InfluxDB itself more difficult and it doesn’t happen that frequently to begin with, but we sometimes update InfluxDB after making a breaking change to Flux.

Thanks, I will have a look!