bottin-ag/apiclient/apiclient.go

20 lines
466 B
Go
Raw Normal View History

// Package apiclient provides the API client used by the web app
package apiclient
import (
"fmt"
"net/http"
2023-09-18 18:34:53 -04:00
"codeberg.org/vlbeaudoin/voki"
"git.agecem.com/agecem/bottin-ag/apiresponse"
)
type APIClient struct {
2023-09-18 18:34:53 -04:00
Voki *voki.Voki
}
func (a *APIClient) Scan(membreID string) (response apiresponse.ScanPOST, err error) {
//TODO implement api key
2023-09-19 16:57:39 -04:00
return response, a.Voki.Unmarshal(http.MethodPost, fmt.Sprintf("/v0/scan/%s", membreID), nil, true, &response)
}