More changes
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 26s
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 26s
This commit is contained in:
14
mysubaru.go
14
mysubaru.go
@ -2,6 +2,7 @@ package mysubaru
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log/slog"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -13,6 +14,19 @@ type Response struct {
|
||||
Data json.RawMessage `json:"data"` // Data struct
|
||||
}
|
||||
|
||||
// parse .
|
||||
func (r *Response) parse(b []byte, logger *slog.Logger) bool {
|
||||
err := json.Unmarshal(b, &r)
|
||||
if err != nil {
|
||||
logger.Error("error while parsing json", "error", err.Error())
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Unmarshal .
|
||||
// func (r *Response) Unmarshal(b []byte) {}
|
||||
|
||||
// Account .
|
||||
type Account struct {
|
||||
MarketID int `json:"marketId"`
|
||||
|
Reference in New Issue
Block a user