// NewHosts returns a new Hosts structure
431760
func (n *Narcissus) NewHosts() (h *Hosts, err error) {
	h = &Hosts{}
	err = n.Parse(h)
	return
}
319577
func NewMain() *Main {
	return &Main{
		Hosts:       []string{"localhost:9092"},
		Topics:      []string{"test"},
		Group:       "group0",
		RegistryURL: "localhost:8081",
		PilosaHosts: []string{"localhost:10101"},
		Index:       "pdk",
		BatchSize:   1000,
		Proxy:       ":13131",
	}
}
403173
func (m *PostgresCreator) NewHashMap(id string) (pinterface.IHashMap, error) {
	return NewHashMap(m.host, id)
}
471938
func NewPerHost(defaultDialer, bypass Dialer) *PerHost {
	return &PerHost{
		def:    defaultDialer,
		bypass: bypass,
	}
}
652414
func (c *Client) AddHost(p *AddHostParameter) (*Host, error) {
	obj, err := c.Request("addHost", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Host), err
}
726602
func newConfigV3() *configV3 {
	conf := new(configV3)
	conf.Version = "3"
	conf.Aliases = make(map[string]string)
	conf.Hosts = make(map[string]hostConfigV3)
	return conf
}
753910
func (p *HostList) Hosts() ([]string, error) {
	var hosts []string

	data, err := ioutil.ReadFile(p.filePath)
	if err != nil {
		return nil, err
	}

	err = json.Unmarshal(data, &hosts)
	if err != nil {
		return nil, err
	}

	return hosts, nil
}
267567
func NewVHostListener(hostID string, handler VHostHandler) *VHostListener {
	return &VHostListener{
		hostID:  hostID,
		handler: handler,
	}
}
1149599
func NewClientByHost(host string) Kubernetes {
	tr := &http.Transport{
		TLSClientConfig: &tls.Config{
			InsecureSkipVerify: true,
		},
		DisableCompression: true,
	}

	c := &http.Client{
		Transport: tr,
	}

	return &client{
		opts: &api.Options{
			Client:    c,
			Host:      host,
			Namespace: "default",
		},
	}
}
742571
func (s *HostService) NewAddBaremetalHostParams(hypervisor string, password string, podid string, url string, username string, zoneid string) *AddBaremetalHostParams {
	p := &AddBaremetalHostParams{}
	p.p = make(map[string]interface{})
	p.p["hypervisor"] = hypervisor
	p.p["password"] = password
	p.p["podid"] = podid
	p.p["url"] = url
	p.p["username"] = username
	p.p["zoneid"] = zoneid
	return p
}
705272
func NewHost(ip net.IP, hostname string, aliases ...string) Host {
	return Host{
		IP:       ip,
		Hostname: hostname,
		Aliases:  aliases,
	}
}
208703
func (c *Client) Hosts() ([]*Host, error) {
	insts, err := c.s.Instances()
	if err != nil {
		return nil, err
	}
	hosts := make([]*Host, len(insts))
	for i, inst := range insts {
		hosts[i] = NewHost(
			inst.Meta["id"],
			inst.Addr,
			c.h,
			HostTagsFromMeta(inst.Meta),
		)
	}
	return hosts, nil
}
264999
func NewHostRegistryListener(poolid string, handler VirtualIPUnassignmentHandler) *HostRegistryListener {
	return &HostRegistryListener{
		poolid:   poolid,
		handler:  handler,
		isOnline: make(chan struct{}),
	}
}
155566
func (a *api) GetHosts() ([]host.Host, error) {
	client, err := a.connectMaster()
	if err != nil {
		return nil, err
	}

	return client.GetHosts()
}
1100199
func rawHost(host string) string {
	u, err := url.Parse(host)
	utils.Check(err)

	if u.IsAbs() {
		return u.Host
	} else {
		return u.Path
	}
}
489221
func NewHostWithDSN(connectionString string, dbname string) *Host {

	db, err := sql.Open("mysql", connectionString)
	if err != nil {
		log.Fatalln("Could not connect to " + connectionString + "!")
	}
	host := &Host{db, dbname, false}
	if err := host.Ping(); err != nil {
		log.Fatalln("Host does not reply to ping: " + err.Error())
	}
	if err := host.createDatabase(); err != nil {
		log.Fatalln("Could not create database " + host.dbname + ": " + err.Error())
	}
	if err := host.useDatabase(); err != nil {
		panic("Could not use database " + host.dbname + ": " + err.Error())
	}
	return host
}
379727
func (s *Server) UpdateHost(host host.Host, _ *struct{}) error {
	return s.f.UpdateHost(s.context(), &host)
}