Go-lang RPC client for Wharf
A library to talk to Wharf via Wharf's main API written in Go.
Uses net/http
to send HTTP requests and encoding/json
to
serialize/deserialize each message back and forth.
This project is for example used inside the providers to create projects
into the database when importing from GitLab, GitHub, or Azure DevOps.
Usage
package main
import (
"fmt"
"github.com/iver-wharf/wharf-api-client-go/pkg/wharfapi"
)
func main() {
client := wharfapi.Client{
APIURL: "https://example.wharf.com",
AuthHeader: "Bearer some-auth-token",
}
project,err := client.GetProjectByID(125)
if err != nil {
fmt.Printf("Unable to find project\n")
} else {
fmt.Printf("Project #%d: %s\n", project.ProjectID, project.Name)
}
}
Sample output
GET | PROJECT | 125
Project #125: MyProject
Linting Golang
go get -u github.com/mgechev/revive
npm run lint-go
Linting markdown
npm install
npm run lint-md
# Some errors can be fixed automatically. Keep in mind that this updates the
# files in place.
npm run lint-md-fix
Linting
You can lint all of the above at the same time by running:
npm run lint
# Some errors can be fixed automatically. Keep in mind that this updates the
# files in place.
npm run lint-fix
Maintained by Iver.
Licensed under the MIT license.