Categorygithub.com/weavc/crusch
repositorypackage
0.0.0-20220410000120-4456295d472f
Repository: https://github.com/weavc/crusch.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

tests GoDoc

Crusch is a lightweight libary which provides tools for Github Apps to communicate with Githubs V3 API, without too much unnecessary hassle.

This libary provides a simple client structure to make requests to Githubs API. Clients aid with adding and creating the required authorization headers, keeping track of when they might need to be renewed and other small helper methods.

If you are looking for something more complete then go-github is probably for you. go-github is a more complete libary with types, seperate methods and bindings for every request github offers, which for what I was working on, was too complicated and quite annoying to work with when all I wanted was something simple, hence crusch.

Usage

import "github.com/weavc/crusch"

basic installation example

var v []map[string]interface{}
authorizer, err := crusch
    .NewInstallationAuth(<ApplicationID int64>, <InstallationID int64>, <rsaKey *rsa.PrivateKey>)

res, err := crusch.Client.Get(
    authorizer, 
    "/repos/weavc/crusch/issues", 
    "assignee=weavc&state=open", 
    &v)

new client

httpClient := &http.Client{}

client := crusch.NewGithubClient("api.github.com", "https")
client.SetHTTPClient(httpClient)