// SetProxyMode starts this server in SSH proxying mode
973712
func SetProxyMode(tsrv reversetunnel.Server) ServerOption {
	return func(s *Server) error {
		// always set proxy mode to true,
		// because in some tests reverse tunnel is disabled,
		// but proxy is still used without it.
		s.proxyMode = true
		s.proxyTun = tsrv
		return nil
	}
}
598688
func (h *FileHeader) SetMode(mode os.FileMode) {
	h.CreatorVersion = h.CreatorVersion&0xff | creatorUnix<<8
	h.ExternalAttrs = fileModeToUnixMode(mode) << 16

	// set MSDOS attributes too, as the original zip does.
	if mode&os.ModeDir != 0 {
		h.ExternalAttrs |= msdosDir
	}
	if mode&0200 == 0 {
		h.ExternalAttrs |= msdosReadOnly
	}
}
57858
func (c *Config) ParseProxyHost(proxyHost string) error {
	host, port, err := net.SplitHostPort(proxyHost)
	if err != nil {
		host = proxyHost
		port = ""
	}

	// Split on comma.
	parts := strings.Split(port, ",")

	switch {
	// Default ports for both the SSH and Web proxy.
	case len(parts) == 0:
		c.WebProxyAddr = net.JoinHostPort(host, strconv.Itoa(defaults.HTTPListenPort))
		c.SSHProxyAddr = net.JoinHostPort(host, strconv.Itoa(defaults.SSHProxyListenPort))
	// User defined HTTP proxy port, default SSH proxy port.
	case len(parts) == 1:
		webPort := parts[0]
		if webPort == "" {
			webPort = strconv.Itoa(defaults.HTTPListenPort)
		}
		c.WebProxyAddr = net.JoinHostPort(host, webPort)
		c.SSHProxyAddr = net.JoinHostPort(host, strconv.Itoa(defaults.SSHProxyListenPort))
	// User defined HTTP and SSH proxy ports.
	case len(parts) == 2:
		webPort := parts[0]
		if webPort == "" {
			webPort = strconv.Itoa(defaults.HTTPListenPort)
		}
		sshPort := parts[1]
		if sshPort == "" {
			sshPort = strconv.Itoa(defaults.SSHProxyListenPort)
		}
		c.WebProxyAddr = net.JoinHostPort(host, webPort)
		c.SSHProxyAddr = net.JoinHostPort(host, sshPort)
	default:
		return trace.BadParameter("unable to parse port: %v", port)
	}

	return nil
}
975285
func (soc *Socket) SetSocksProxy(value string) error {
	if minor < 1 {
		return ErrorNotImplemented41
	}
	if value == "" {
		return soc.setNullString(C.ZMQ_SOCKS_PROXY)
	}
	return soc.setString(C.ZMQ_SOCKS_PROXY, value)
}
921599
func (s *SSL) SetVerifyMode(options VerifyOptions) {
	s.SetVerify(options, s.verify_cb)
}
1186366
func (s *HeadObjectOutput) SetObjectLockMode(v string) *HeadObjectOutput {
	s.ObjectLockMode = &v
	return s
}
1177468
func (s *InstanceAccessDetails) SetProtocol(v string) *InstanceAccessDetails {
	s.Protocol = &v
	return s
}
1039952
func (p *PortDefinition) SetProtocol(protocol string) *PortDefinition {
	p.Protocol = protocol
	return p
}
258711
func (o *Disk) SetMode(v *string) *Disk {
	if o.Mode = v; o.Mode == nil {
		o.nullFields = append(o.nullFields, "Mode")
	}
	return o
}
812746
func (s *DescribeEndpointsInput) SetMode(v string) *DescribeEndpointsInput {
	s.Mode = &v
	return s
}
635976
func (m *Manager) newProxyFromMode(mode structs.ProxyExecMode, id string) (Proxy, error) {
	switch mode {
	case structs.ProxyExecModeDaemon:
		return &Daemon{
			Logger:  m.Logger,
			PidPath: pidPath(filepath.Join(m.DataDir, "pids"), id),
		}, nil

	default:
		return nil, fmt.Errorf("unsupported managed proxy type: %q", mode)
	}
}
810979
func (s *ModifyCacheClusterInput) SetAZMode(v string) *ModifyCacheClusterInput {
	s.AZMode = &v
	return s
}
212336
func (p *Proxy) SetProxyPort(name string, port uint16) error {
	proxyPortsMutex.Lock()
	defer proxyPortsMutex.Unlock()
	pp := findProxyPort(name)
	if pp == nil {
		return fmt.Errorf("Can't find proxy port %s", name)
	}
	if pp.nRedirects > 0 {
		return fmt.Errorf("Can't set proxy port to %d: proxy %s is already configured on %d", port, name, pp.proxyPort)
	}
	pp.proxyPort = port
	pp.configured = true
	return p.ackProxyPort(pp)
}
987999
func (s *PutRestApiInput) SetMode(v string) *PutRestApiInput {
	s.Mode = &v
	return s
}
1217280
func (c *client) SetServerMode(ctx context.Context, mode ServerMode) error {
	req, err := c.conn.NewRequest("PUT", "_admin/server/mode")
	if err != nil {
		return WithStack(err)
	}
	input := serverModeRequest{
		Mode: mode,
	}
	req, err = req.SetBody(input)
	if err != nil {
		return WithStack(err)
	}
	resp, err := c.conn.Do(ctx, req)
	if err != nil {
		return WithStack(err)
	}
	if err := resp.CheckStatus(200); err != nil {
		return WithStack(err)
	}
	return nil
}
267132
func (s *InstancePortInfo) SetProtocol(v string) *InstancePortInfo {
	s.Protocol = &v
	return s
}
217849
func (s *TracingConfigResponse) SetMode(v string) *TracingConfigResponse {
	s.Mode = &v
	return s
}