Skip to content

rovergulf/kanyerest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github.com/rovergulf/kanyerest

kanye.rest Go client library

Install library

go get github.com/rovergulf/kanyerest

Example usage

package main

import (
	"log"
	"context"
	"net/http"
	
	"github.com/rovergulf/kanyerest"
)

func main() {
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()
	
	httpClient := &http.Client{Timeout: 5 * time.Second}
	
	yeClient := kanyerest.NewYeClient(httpCLient)
	
	res, err := yeClient.GetQuote(ctx)
	if err != nil {
		log.Fatal(err)
	}
	
	log.Println(res.Quote)
}