package model import ( "encoding/json" "go.etztech.xyz/go-mcm/internal" "go.etztech.xyz/go-mcm/model/django" ) type IP struct { ID int64 `json:"id"` PlayerID int64 `json:"player_id"` LastUsed string `json:"last_used"` Link string `json:"link"` } func (q *Model) IP(builder *django.Builder) ([]*IP, error) { endpoint := q.endpoint("ip", builder.QueryString()) ips := make([]*IP, 0) resp, err := internal.ResponseGet(endpoint) if err != nil { return nil, err } err = json.Unmarshal(resp, &ips) if err != nil { return nil, err } return ips, nil }