Example #1
0
File: get.go Project: grunya404/dns
func parseRow(row connection.Row) (Domain, error) {
	d := Domain{}
	var dUUID string
	var tldID int32
	err := row.Scan(&dUUID, &d.Name, &tldID)
	if err != nil {
		return d, err
	}
	d.UUID = uuid.Parse(dUUID)
	d.TLD, err = tlds.GetByID(tldID).One()
	return d, err
}
Example #2
0
File: get.go Project: grunya404/dns
func parseRow(row connection.Row) (Parser, error) {
	p := Parser{}
	var tldID int32
	var jsonBuf []byte
	err := row.Scan(&p.ID, &p.Filename, &p.Started, &p.Finished, &p.Date, &tldID, &jsonBuf)
	if err != nil {
		return p, err
	}
	err = json.Unmarshal(jsonBuf, &p.Logs)
	if err != nil {
		return p, err
	}
	t, err := tlds.GetByID(tldID).One()
	p.TLD = t
	return p, err
}