byName is a type. It's a named type based (likely) on a slice of machines. The byName type implements the functions necessary to support the interface that the sort.Sort function requires:
type byName []Machine
func (b byName) Len() int { return len(b) }
func (b byName) Swap(i, j int) { b[j], b[i] = b[i], [b[j] }
func (b byName) Less(i, j int) { return b[i].Name < b[j].Name }
sort.Sort takes an interface type that has the methods Len, Swap, and Less, as defined in the signatures above, and uses them in a sorting algorithm which sorts the values in-place.