`go-redash-query` is a simple library to get structed data from `redash query` sources

Overview

go-redash-query

go-redash-query is a simple library to get structed data from redash query sources

Example

Source table

id name email
1 Dannyhann [email protected]
2 foo [email protected]
3 bar [email protected]

Source query

SELECT id, name, email 
FROM test_user 
WHERE id > {{id}}
ORDER BY id ASC 
LIMIT {{size}}

Usage

package main

import (
	"fmt"
	"go-redash-query"
	"log"
)

var (
	redashQueryId = 1 // Redash QueryId
	redashApiUrl  = ""
	redashAPiKey  = ""
)

type TestUserData struct {
	Id    int    `json:"id" mapstructure:"id"`
	Name  string `json:"name" mapstructure:"name"`
	Email string `json:"email" mapstructure:"email"`
}

func main() {

	client := go_redash_query.CreateClient(redashApiUrl, redashAPiKey)

	queryData := go_redash_query.QueryData{
		MaxAge: 10,
		Parameters: go_redash_query.P{
			"id":   1,
			"size": 20,
		},
	}

	job, err := client.CreateJobWithQuery(redashQueryId, queryData)
	if err != nil {
		log.Fatalf("CreateJobWithQuery %s", err)
	}

	fetchedData, err := client.Fetch(job)
	if err != nil {
		log.Fatalf("Fetch %s", err)
	}

	users := make([]TestUserData, 0)

	err = fetchedData.GetDataWithStruct(&users)
	if err != nil {
		log.Fatal(err)
	}

	for _, user := range users {
		fmt.Printf("%d %s %s\n", user.Id, user.Name, user.Email)
	}
}
Releases(v0.1.1)
Owner
danny han
danny han
Solving structy.net data structures & algorithms programming problems in Go (with Tests)

structy.net Solving structy.net data structures & algorithms programming problems in Go (with Tests) I. Introduction 000. hey programmer 001. max-valu

Julian Popov 8 Mar 19, 2022
About An instrumented microservice in Go - it'll give you some Honeycomb data to play with.

Intro to Observability: OpenTelemetry in Go This application is here for you to try out tracing. It consists of a microservice that calls itself, so y

Honeycomb 1 Apr 1, 2022
An experimental generic functional utility library inspired by Lodash

go-godash An experimental generic functional utility library inspired by Lodash Implemented functions Map Reduce Sum Filter Take TakeWhile Drop DropWh

Stewart Platt 6 Jan 17, 2022
Goro: A High-level Machine Learning Library for Go

Overview Goro is a high-level machine learning library for Go built on Gorgonia. It aims to have the same feel as Keras. Usage import ( . "github.

AUNUM 294 Apr 16, 2022
A library providing useful functional programming helpers for Go 1.18

Underscore underscore is a Go library providing useful functional programming helpers without extending any built-in objects. It is mostly a port from

Ruidy 43 May 5, 2022
Clarifai - Clarifai library for Golang

Clarifai Golang Library Library for our v1 API. Disclaimer This API client only

Clarifai 56 Apr 29, 2022
Go-openoffice - Go library for reading OpenOffice odf and ods files

go-openoffice A Go library for reading OpenOffice/LibreOffice .ods (and .odf) fi

Multiprocess Labs LLC 2 Feb 17, 2022
Go-integrals - A numerical integration library in GoLang

Go Integrals About Go Integrals is an implementation of numerical integration al

João Marcelo Cardoso Carvalho 0 Jan 19, 2022
An open source programming language that makes it easy to build simple

The Go Programming Language Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. Gopher ima

null 0 Oct 15, 2021
This is an example of a keep-it-simple directory layout for Go projects that was created using DDD principles, please copy and share if you like it.

DDD Go Template This project was created to illustrate a great architectural structure I developed together with @fabiorodrigues in the period I was w

Vinícius Garcia 26 Apr 26, 2022
Repository for COMP 429 Programming Assignment# 1 - A simple chat application, by Sabra Bilodeau.

Chatty COMP 429 Programming Assignment 1 A Chat Application for Remote Message Exchange by Sabra Bilodeau Getting Started with Chatty Building the Pro

Sabra Bilodeau 0 Nov 28, 2021
Simple first method GRPC on GO

Simple first method GRPC on GO

Van Thinh Nguyen 4 Dec 10, 2021
Simple Notifier/Listener utility package to pass around messages in-memory

Simple Observer (go) A small simple library to use for sending around messages in-memory. It uses a notifier/listener style messaging. Installation go

Daniël Pot 1 Dec 7, 2021
Simple script for farm free books from PackPub.com

Bookgot BookGot is a simple boot for farm free books from PACKTPUB.COM #Install go get -u github.com/bregydoc/Bookgot Usage First import BookGot //..

Bregy Malpartida 9 Mar 26, 2019
Redash-go-sdk - An SDK for the programmatic management of Redash, in Go

Redash Go SDK An SDK for the programmatic management of Redash. The main compone

RecoLabs 24 Mar 3, 2022
xyr is a very lightweight, simple and powerful data ETL platform that helps you to query available data sources using SQL.

xyr [WIP] xyr is a very lightweight, simple and powerful data ETL platform that helps you to query available data sources using SQL. Supported Drivers

Mohammed Al Ashaal 55 Apr 4, 2022
Prometheus Common Data Exporter can parse JSON, XML, yaml or other format data from various sources (such as HTTP response message, local file, TCP response message and UDP response message) into Prometheus metric data.

Prometheus Common Data Exporter Prometheus Common Data Exporter 用于将多种来源(如http响应报文、本地文件、TCP响应报文、UDP响应报文)的Json、xml、yaml或其它格式的数据,解析为Prometheus metric数据。

null 6 Apr 20, 2022
Use SQL to instantly query resources, data sources and more from Terraform code. Open source CLI. No DB required.

Terraform Plugin for Steampipe Use SQL to query data from Terraform configuration files. Get started → Documentation: Table definitions & examples Com

Turbot 9 Feb 18, 2022
Graphoscope: a solution to access multiple independent data sources from a common UI and show data relations as a graph

Graphoscope A solution to access multiple independent data sources from a common UI and show data relations as a graph: Contains a list of by default

CERT.LV 27 Apr 26, 2022
Cfginterpolator is an interpolate library in golang allowing to include data from external sources in your configuration

cfginterpolator cfginterpolator is an interpolate library in golang allowing to include data from external sources in your configuration cfginterpolat

Benoit Bayszczak 0 Dec 14, 2021
A library for the MIGP (Might I Get Pwned) protocolA library for the MIGP (Might I Get Pwned) protocol

MIGP library This contains a library for the MIGP (Might I Get Pwned) protocol. MIGP can be used to build privacy-preserving compromised credential ch

Cloudflare 21 Dec 16, 2021
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.

The open-source platform for monitoring and observability. Grafana allows you to query, visualize, alert on and understand your metrics no matter wher

Grafana Labs 49k May 18, 2022
sq is a command line tool that provides jq-style access to structured data sources such as SQL databases, or document formats like CSV or Excel.

sq: swiss-army knife for data sq is a command line tool that provides jq-style access to structured data sources such as SQL databases, or document fo

Neil O'Toole 379 May 1, 2022
RuuviBridge - Utility to bridge RuuviTag data between various sources and consumers

RuuviBridge RuuviBridge is designed to act as a "data bridge" between various so

Scrin 5 Apr 23, 2022
Mergestat - a command-line tool for running SQL queries on git repositories and related data sources

Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. ?? ??

MergeStat 3k May 10, 2022
Harvit harvests data from different sources (e.g websites, APIs), converts and transforms it.

harvit Harvit harvests data from different sources (e.g websites, APIs), converts and transforms it. Contents harvit Contents Requirements Usage Examp

Michaël Giovanni Jules 2 May 9, 2022
Redis-benchmark - Simple get, mget and pipelined get benchmark.

redis-benchmark Simple get, mget and pipelined get benchmark. Usage git clone https://github.com/Ali-A-A/redis-benchmark.git cd ./redis-benchmark dock

Ali Abbasi Alaei 0 Dec 31, 2021
Know your customer library. The sources are OFAC, UK sanctions, Interpol, Wikidata, etc.

KYC/AML check The package provides a level of know your customer service for banking and other financial services. Note: They may have some missing re

Tarık Yılmaz 2 Feb 2, 2022
Go-get-it - Simple database query script for UNIX-terminal usage

go-get-it Simple database query script for UNIX-terminal usage Supports MongoDB Quick start Commands: Usage of ggi: -c string MongoDB collectio

Andrew Aleynikov 0 Mar 16, 2022