// WithDisableEndpointHostPrefix will set whether or not to use modeled host prefix
// when making requests.
774651
func (c *Config) WithDisableEndpointHostPrefix(t bool) *Config {
	c.DisableEndpointHostPrefix = &t
	return c
}
1293398
func isCertVerificationDisabledForHost(c *Client, host string) bool {
	hostSslVerify, _ := c.uc.Get("http", fmt.Sprintf("https://%v", host), "sslverify")
	if hostSslVerify == "false" {
		return true
	}

	return c.SkipSSLVerify
}
914013
func (c *Client) EnablePublicEndpointPort(serviceid, endpointName, portAddr string, isEnabled bool) error {
	request := &PublicEndpointRequest{
		Serviceid:    serviceid,
		EndpointName: endpointName,
		Name:         portAddr,
		IsEnabled:    isEnabled,
	}
	return c.call("EnablePublicEndpointPort", request, nil)
}
690051
func DefaultHTTPEndpoint() string {
	config := &Config{HTTPHost: DefaultHTTPHost, HTTPPort: DefaultHTTPPort}
	return config.HTTPEndpoint()
}
202213
func makeEndpointURL(listenIP string, listenPort int) (string, error) {
	if listenIP != "0.0.0.0" {
		return fmt.Sprintf("http://%v:%v", listenIP, listenPort), nil
	}
	privateIPs, err := iptools.GetPrivateHostIPs()
	if err != nil {
		return "", fmt.Errorf("failed to obtain host's private IPs: %v", err)
	}
	if len(privateIPs) == 0 {
		return "", errors.New("no host's private IPs are found")
	}
	return fmt.Sprintf("http://%v:%v", privateIPs[0], listenPort), nil
}
165155
func buildPortsToEndpointsMap(endpoints *v1.Endpoints) map[string][]hostPortPair {
	portsToEndpoints := map[string][]hostPortPair{}
	for i := range endpoints.Subsets {
		ss := &endpoints.Subsets[i]
		for i := range ss.Ports {
			port := &ss.Ports[i]
			for i := range ss.Addresses {
				addr := &ss.Addresses[i]
				portsToEndpoints[port.Name] = append(portsToEndpoints[port.Name], hostPortPair{addr.IP, int(port.Port)})
				// Ignore the protocol field - we'll get that from the Service objects.
			}
		}
	}
	return portsToEndpoints
}
360273
func (c *Client) EndpointConfigPatch(id string, cfg *models.EndpointConfigurationSpec) error {
	params := endpoint.NewPatchEndpointIDConfigParams().WithID(id).WithTimeout(api.ClientTimeout)
	if cfg != nil {
		params.SetEndpointConfiguration(cfg)
	}

	_, err := c.Endpoint.PatchEndpointIDConfig(params)
	return Hint(err)
}
581032
func WithContextEndpointType(endpointName string, endpointType store.TypeGetter) DockerCliOption {
	return func(cli *DockerCli) error {
		switch endpointName {
		case docker.DockerEndpoint, kubernetes.KubernetesEndpoint:
			return fmt.Errorf("cannot change %q endpoint type", endpointName)
		}
		cli.contextStoreConfig.SetEndpoint(endpointName, endpointType)
		return nil
	}
}
369962
func (c *Config) WithDisableParamValidation(disable bool) *Config {
	c.DisableParamValidation = &disable
	return c
}
1040736
func (c *Config) WithDisableSSL(disable bool) *Config {
	c.DisableSSL = &disable
	return c
}
187566
func (c *Client) AddPublicEndpointPort(serviceid, endpointName, portAddr string, usetls bool,
	protocol string, isEnabled bool, restart bool) (*servicedefinition.Port, error) {
	request := &PublicEndpointRequest{
		Serviceid:    serviceid,
		EndpointName: endpointName,
		Name:         portAddr,
		UseTLS:       usetls,
		Protocol:     protocol,
		IsEnabled:    isEnabled,
		Restart:      restart,
	}
	var result servicedefinition.Port
	err := c.call("AddPublicEndpointPort", request, &result)
	return &result, err
}
544193
func (c *Config) HTTPEndpoint() string {
	if c.HTTPHost == "" {
		return ""
	}
	return fmt.Sprintf("%s:%d", c.HTTPHost, c.HTTPPort)
}
322508
func (s *CreateServerInput) SetEndpointType(v string) *CreateServerInput {
	s.EndpointType = &v
	return s
}
749317
func (_m *FacadeInterface) AddPublicEndpointVHost(ctx datastore.Context, serviceid string, endpointName string, vhost string, isEnabled bool, restart bool) (*servicedefinition.VHost, error) {
	ret := _m.Called(ctx, serviceid, endpointName, vhost, isEnabled, restart)

	var r0 *servicedefinition.VHost
	if rf, ok := ret.Get(0).(func(datastore.Context, string, string, string, bool, bool) *servicedefinition.VHost); ok {
		r0 = rf(ctx, serviceid, endpointName, vhost, isEnabled, restart)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*servicedefinition.VHost)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(datastore.Context, string, string, string, bool, bool) error); ok {
		r1 = rf(ctx, serviceid, endpointName, vhost, isEnabled, restart)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1168888
func (s *DescribedServer) SetEndpointType(v string) *DescribedServer {
	s.EndpointType = &v
	return s
}
839417
func (c *Client) AddPublicEndpointVHost(serviceid, endpointName, vhost string, isEnabled,
	restart bool) (*servicedefinition.VHost, error) {
	request := &PublicEndpointRequest{
		Serviceid:    serviceid,
		EndpointName: endpointName,
		Name:         vhost,
		IsEnabled:    isEnabled,
		Restart:      restart,
	}
	var result servicedefinition.VHost
	err := c.call("AddPublicEndpointVHost", request, &result)
	return &result, err
}
324078
func (n *NodeAbstractResource) ReferenceableAddrs() []addrs.Referenceable {
	return []addrs.Referenceable{n.Addr.Resource}
}