Go API wrapper for Greenhouse.io API

Greenhouse IO

A Go interface to Greenhouse.io's API

Useage

Creating the Client

NewClient accepts:

  • A context; used for any HTTP requests made using the client.
  • Any struct implementing the httpClient interface; this allows for useage of other HTTP clients, like go-retryablehttp.
  • The API token.
client, err := greenhouseio.NewClient(
  context.Background(),
  &http.Client{
    Timeout: httpTimeout,
  },
  os.Getenv("GREENHOUSE_API_KEY"),
)

Single Request

All candidates

candidates, err := client.Candidates().Fetch()

All candidates created before

candidates, err := client.Candidates().CreatedBefore(time.Now()).Fetch()

Streaming

Streaming puts each resource loaded into a given consumer channel while following the next URL found in each response header. When an error occurs or no next URL is found, an error or nil is sent to a given close signal channel.

All candidates

candidates, closeSignal := make(chan *models.Candidate), make(chan error)
go client.Candidates().Stream(candidates, closeSignal)

for {
	select {
	case err := <-closeSignal:
		if err != nil {
			log.Fatalf("error streaming candidates: %v", err)
		}

		os.Exit(0)
	case candidate := <-candidates:
		log.Default().Println("streamed", candidate.ID)
	}
}

API Documentation

Documentation for the Harvest and Job Board web APIs can be found at developers.greenhouse.io.

Development

Prerequisites

Installing Go and golangci-lint via Brew

brew install go golangci-lint
echo "export PATH=~/go/bin/:$PATH" >> ~/.zshrc

Commands

Linting

make lint

Run tests

make test
Similar Resources

Tiny 10MinuteMail wrapper for Go.

tmm Tiny package that uses 10MinuteMail to generate temporary email addresses. Zero dependancies. Supports receiving, forwarding and replying to messa

Nov 29, 2021

A simple Via CEP Wrapper to demonstrate GoLang tests usage

via-cep-wrapper A simple Via CEP Wrapper to demonstrate GoLang tests usage Purpose Demonstrate how struct services could make easy to build and test a

May 18, 2022

Executor - Wrapper for exec.Command for simple using and multi commands executing

executor Examples package main import ( "fmt" "github.com/solar-jsoc/execut

Feb 12, 2022

Basic-api-with-go - A basic api with golang

I am creating my first API with GO. Install go get -u github.com/Yefhem/basic-ap

Jan 3, 2022

:sunglasses:Package captcha provides an easy to use, unopinionated API for captcha generation

Package captcha provides an easy to use, unopinionated API for captcha generation. Why another captcha generator? I want a simple and framework-indepe

Dec 28, 2022

Fast conversions across various Go types with a simple API.

Go Package: conv Get: go get -u github.com/cstockton/go-conv Example: // Basic types if got, err := conv.Bool(`TRUE`); err == nil { fmt.Printf("conv.

Nov 29, 2022

Go language interface to the PAPI performance API

go-papi Description go-papi provides a Go interface to PAPI, the Performance Application Programming Interface. PAPI provides convenient access to har

Dec 22, 2022

Yubigo is a Yubikey client API library that provides an easy way to integrate the Yubico Yubikey into your existing Go-based user authentication infrastructure.

yubigo Yubigo is a Yubikey client API library that provides an easy way to integrate the Yubikey into any Go application. Installation Installation is

Oct 27, 2022

godesim Simulate complex systems with a simple API.

godesim Simulate complex systems with a simple API. Wrangle non-linear differential equations while writing maintainable, simple code. Why Godesim?

Jan 5, 2023
A wrapper for the Wandbox API, written in Golang!

GoWandBox A simple wrapper for the WandBox API, written in Golang! Documentation can be found at classpythonaddike.github.io/gowandbox/ Note: This wra

Sep 19, 2021
Interkassa api wrapper in golang.

Golang https://interkassa.com/ api wrapper (WIP) Как использовать Создаём кассу package main import ( "net/http" "time" "github.com/qystishere/in

Jun 30, 2022
A dead simple Go wrapper around the hidden moonarch.app API.

moonarch A dead simple Go wrapper around the hidden moonarch.app API. How-To First, get the repository: go get github.com/lazdotdigital/moonarch. moon

Nov 27, 2021
A simple wrapper to daemonize Go applications.

daemonigo A simple library to daemonize Go programming language applications. Installing $ go get github.com/tyranron/daemonigo After this command da

Jul 15, 2022
Some helper types for go1: priority queue, slice wrapper.

go-villa Package villa contains some helper types for Go: priority queue, slice wrapper, binary-search, merge-sort. GoDoc Link: http://godoc.org/githu

Apr 24, 2021
singleflight wrapper supporting contexts

contextflight contextflight is a thin wrapper around singleflight that adds context handling. It works like singleflight, with the addition that the p

Nov 9, 2022
rsync wrapper (or output parser) that pushes metrics to prometheus

rsync-prom An rsync wrapper (or output parser) that pushes metrics to prometheus. This allows you to then build dashboards and alerting for your rsync

Dec 11, 2022
GoSetProcessAffinity as a wrapper with GUI
GoSetProcessAffinity as a wrapper with GUI

GoSetProcessAffinity as a wrapper with GUI basically this is a configuration tool for the IFEO settings. Settings that go beyond the IFEO are done via

Sep 24, 2022
Testing the use of a golang wrapper around UserMode Linux for making stdin

This code is for testing the use of a golang wrapper around UserMode Linux for making stdin, stdout and stderr available to attach, detach and reattach to from the host using Unix sockets.

Dec 24, 2021
Rusprofile wrapper with golang

Rusprofile Wrapper Запуск docker-compose up Описание Swagger http://localhost:8080/swagger/ Можно было бы брать данные здесь: https://www.rusprofile.r

Nov 24, 2021