Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (31 loc) · 1.32 KB

README.md

File metadata and controls

40 lines (31 loc) · 1.32 KB

Test Maintainability Test Coverage Go Report Card GoDoc

redash-sdk-go

Redash client in go. Many APIs are still WIP.

Usage

package main

import (
	"fmt"
	"os"

	"github.com/koooge/redash-sdk-go/redash"
)

const queryId = 1

func main() {
	config := &redash.Config{
		EndpointUrl: os.Getenv("REDASH_ENDPOINT_URL"),
		ApiKey:      os.Getenv("REDASH_API_KEY"),
	}
	client := redash.NewClient(config)

	input := &redash.GetQueryInput{
		QueryId: queryId,
	}

	output := client.GetQuery(input)
	fmt.Println(output.Body)
	fmt.Println(output.StatusCode)
}

See more about sample and doc.