Joustie's blog

Apr 12, 2024 - 1 minute read

Introducing the Leostream Golang client

I have been working on a Leostream client in Golang.

More information about Leostream can be found on Wikipedia:

It is basically a broker for connecting users to remote desktops and applications. These desktops can be running in a variety of environments, including cloud, on-premises, and hybrid environments.

The client I created is a wrapper around the Leostream REST API. It is still in development but I have already implemented some basic functionality. The client is available on my company GitLab instance.

Quick code example to get a list of pools:

package main

import (
    "fmt"
    "os"
    "gitlab.hocmodo.nl/community/leostream-client-go"
)

func main() {

        host := os.Getenv("LEOSTREAM_API_HOSTNAME")
        username := os.Getenv("LEOSTREAM_API_USERNAME")
        password := os.Getenv("LEOSTREAM_API_PASSWORD")

        // Create a new Leostream client using the configuration values
        client, err := leostream.NewClient(&host, &username, &password)

        // Get the list of pools
        pools, err:= client.GetPools()

        // Check if there was an error
        if err != nil {
            fmt.Println(err)

            return
        }

        // Print the list of pools
        for _, pool := range pools {
        fmt.Println(pool.Name)

    }
}

Leostream