Exemple #1
0
func (machines MachineMap) MarshalJSON() ([]byte, error) {
	machinesStrings := make(map[string]*Machine, len(machines))
	for uuid, machine := range machines {
		machinesStrings[uuid.String()] = machine
	}
	return json.Marshal(machinesStrings)
}
Exemple #2
0
func (disks HardDiskMap) MarshalJSON() ([]byte, error) {
	disksStrings := make(map[string]*HardDisk, len(disks))
	for uuid, disk := range disks {
		disksStrings[uuid.String()] = disk
	}
	return json.Marshal(disksStrings)
}