// ProfileMap returns servers mapped by server profile
ProfileMap returns servers mapped by server profile
// ProfileMap returns servers mapped by server profile
func (s *ClusterState) ProfileMap() map[string][]Server {
	out := make(map[string][]Server)
	for i := range s.Servers {
		server := s.Servers[i]
		servers, ok := out[server.Role]
		if !ok {
			out[server.Role] = []Server{server}
		} else {
			servers = append(servers, server)
			out[server.Role] = servers
		}
	}
	return out
}
func ( s * ClusterState ) ProfileMap ( ) map [ string ] [ ] Server { out := make ( map [ string ] [ ] Server ) for i := range s . Servers { server := s . Servers [ i ] servers , ok := out [ server . Role ] if ! ok { out [ server . Role ] = [ ] Server { server } } else { servers = append ( servers , server ) out [ server . Role ] = servers } } return out }
ProfileMap returns servers mapped by server profile
ProfileMap returns servers mapped by server profile