// Set sets an instantiated reverse proxy
770496
func (cache *ReverseProxyCache) Set(hostAddress, privateAddress string, useTLS bool, rp *httputil.ReverseProxy) {
	cache.mu.Lock()
	defer cache.mu.Unlock()
	key := ReverseProxyKey{
		HostAddress: hostAddress,
		PrivateAddress: privateAddress,
		UseTLS:  useTLS,
	}
	cache.data[key] = rp
}
1089794
func Set(servers map[string]string) p.Plugin {
	return p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {
		// Assert http.Transport to work with the instance
		transport, ok := ctx.Client.Transport.(*http.Transport)
		if !ok {
			// If using a custom transport, just ignore it
			h.Next(ctx)
			return
		}

		// Define the proxy function to be used during the transport
		transport.Proxy = func(req *http.Request) (*url.URL, error) {
			if value, ok := servers[req.URL.Scheme]; ok {
				return url.Parse(value)
			}
			return http.ProxyFromEnvironment(req)
		}

		// Override the transport
		ctx.Client.Transport = transport
		h.Next(ctx)
	})
}
512061
func (s Session) Set(key string, value interface{}) error {
	if value == nil {
		s.Del(key)
		return nil
	}

	s[key] = value
	return nil
}
1012358
func (c *Cache) Set(host string, client engine.API) {
	c.Lock()
	defer c.Unlock()
	c.Clients[host] = client
}
932391
func (s *Session) Set(key string, value interface{}) {
	if s.Keys == nil {
		s.Keys = make(map[string]interface{})
	}

	s.Keys[key] = value
}
743637
func (ip *Interpreter) set(args []string) {
	ip.simpleResponder(ip.Backend.SetUserData(args[0], args[1], args[2]))
}
1314243
func (c *proxyCache) Set(application string, portNumber uint16, exports ...registry.ExportDetails) (bool, error) {
	logger := plog.WithFields(log.Fields{
		"application": application,
		"portnumber":  portNumber,
	})

	c.mu.Lock()
	defer c.mu.Unlock()

	key := proxyKey{
		Application: application,
		PortNumber:  portNumber,
	}

	// check if the key exists
	prxy, ok := c.cache[key]
	if !ok {

		logger.Debug("Setting up new proxy")

		// start the listener on the provided port
		listener, err := net.Listen("tcp4", fmt.Sprintf(":%d", portNumber))
		if err != nil {
			logger.WithError(err).Debug("Could not open port")
			return false, err
		}

		logger.Debug("Started port listener")

		// create the proxy
		prxy, err = newProxy(
			fmt.Sprintf("%s-%d", application, portNumber),
			fmt.Sprintf("%s-%s-%d", c.tenantID, application, portNumber),
			c.tcpMuxPort,
			c.useTLS,
			listener,
			c.allowDirect,
		)
		if err != nil {
			logger.WithError(err).Debug("Could not start proxy")
			return false, err
		}

		logger.Debug("Created new proxy for port")
		c.cache[key] = prxy

	}

	// update the proxy addresses
	addresses := make([]addressTuple, len(exports))
	for i, export := range exports {
		addresses[i] = addressTuple{
			host:          export.HostIP,
			containerAddr: fmt.Sprintf("%s:%d", export.PrivateIP, export.PortNumber),
		}
	}
	prxy.SetNewAddresses(addresses)

	logger.Debug("Set exports for proxy")

	return !ok, nil
}
57417
func (c *expvarStatsClient) Set(name string, value string, rate float64) {
	var s expvar.String
	s.Set(value)
	c.m.Set(name, &s)
}
1230329
func (s *StringFlag) Set(in string) error {
	s.string = &in
	return nil
}
757654
func (s *ID) Set(v string) error {
	id, err := ParseID(v)
	if err != nil {
		return trace.Wrap(err)
	}
	*s = *id
	return nil
}
1264458
func (i *Int64Value) Set(s string) error {
	v, err := strconv.ParseInt(s, 0, 64)
	*i = Int64Value(v)
	return err
}
812033
func (c *Connection) Set(property string, value interface{}) error {
	_, err := c.Call("set_property", property, value)
	return err
}
745953
func (s *AttributeValue) SetS(v string) *AttributeValue {
	s.S = &v
	return s
}
99807
func (a MultiStatsClient) Set(name string, value string, rate float64) {
	for _, c := range a {
		c.Set(name, value, rate)
	}
}
700458
func (r *RedisStorer) Set(key, value string) error {
	return r.client.Set(key, value, r.maxAge).Err()
}
433402
func (context *BaseContext) Set(key string, value interface{}) {
	context.userData[key] = value
}
230915
func (nl *NetAddrList) Set(s string) error {
	v, err := ParseAddr(s)
	if err != nil {
		return err
	}

	*nl = append(*nl, *v)
	return nil
}