flareio
is a light Flare API SDK that wraps around net/http.Client and automatically manages authentication.
It exposes methods that are similar to net/http.Client
with the exception that they accept paths as parameters instead of full URLs.
Usage examples and use cases are documented in the Flare API documentation.
make test
will run testsmake format
format will format the codemake lint
will run typechecking + linting
package main
import (
"fmt"
"io"
"os"
"github.com/Flared/go-flareio"
)
func main() {
client := flareio.NewApiClient(
os.Getenv("FLARE_API_KEY"),
)
resp, err := client.Get(
"/tokens/test", nil,
)
if err != nil {
fmt.Printf("failed to test token: %s\n", err)
os.Exit(1)
}
defer resp.Body.Close()
if _, err := io.Copy(os.Stdout, resp.Body); err != nil {
fmt.Printf("failed to print response: %s\n", err)
os.Exit(1)
}
}