// OrderEndpointAsc orders the slice of Endpoint in ascending ID order.
169218
func OrderEndpointAsc(eps []*Endpoint) {
	sort.Slice(eps, func(i, j int) bool { return eps[i].ID < eps[j].ID })
}
1065380
func ParseEndpointType(str string) EndpointType {
	str = strings.ToLower(str)
	switch str {
	case "unix":
		return UnixEndpoint
	case "tcp":
		return TCPEndpoint
	}
	return UnknownEndpointType
}
709592
func (o *PutEndpointIDParams) WithEndpoint(endpoint *models.EndpointChangeRequest) *PutEndpointIDParams {
	o.SetEndpoint(endpoint)
	return o
}
1174830
func WriteEndpoint(keys []*lxcmap.EndpointKey, pm *policymap.PolicyMap) error {
	return writeEndpoint(keys, pm.GetFd())
}
376076
func (s *Container) SetEndpoint(v string) *Container {
	s.Endpoint = &v
	return s
}
407511
func (s *VpcConfigRequest) SetEndpointPrivateAccess(v bool) *VpcConfigRequest {
	s.EndpointPrivateAccess = &v
	return s
}
900215
func (a *LBClient) GetISvcEndpoints(serviceId string, endpoints *map[string][]applicationendpoint.ApplicationEndpoint) error {
	glog.V(4).Infof("ControlCenterAgent.GetISvcEndpoints()")
	return a.rpcClient.Call("ControlCenterAgent.GetISvcEndpoints", serviceId, endpoints, 0)
}
6831
func (c *Config) WithEndpoint(endpoint string) *Config {
	c.Endpoint = &endpoint
	return c
}
1035106
func (s *UpdateServerInput) SetEndpointType(v string) *UpdateServerInput {
	s.EndpointType = &v
	return s
}
158789
func (s *Server) SetEndpoint(v string) *Server {
	s.Endpoint = &v
	return s
}
1281740
func (s *CreateDBClusterEndpointInput) SetEndpointType(v string) *CreateDBClusterEndpointInput {
	s.EndpointType = &v
	return s
}
1083473
func (s *DescribeEndpointInput) SetEndpointType(v string) *DescribeEndpointInput {
	s.EndpointType = &v
	return s
}
280501
func (ep *multiPortEndpoint) selectEndpoint(id TransportEndpointID) TransportEndpoint {
	ep.mu.RLock()
	defer ep.mu.RUnlock()

	payload := []byte{
		byte(id.LocalPort),
		byte(id.LocalPort >> 8),
		byte(id.RemotePort),
		byte(id.RemotePort >> 8),
	}

	h := jenkins.Sum32(ep.seed)
	h.Write(payload)
	h.Write([]byte(id.LocalAddress))
	h.Write([]byte(id.RemoteAddress))
	hash := h.Sum32()

	idx := reciprocalScale(hash, uint32(len(ep.endpointsArr)))
	return ep.endpointsArr[idx]
}
611194
func (b ConnectionStringBuilder) WithEndpoint(endpoint string) ConnectionStringBuilder {
	b.endpoint = endpoint
	return b
}
321283
func (s *Connection) SetEndpointArn(v string) *Connection {
	s.EndpointArn = &v
	return s
}
749090
func (c *EndpointConfig) loadOrdererPeerTLSConfig(configEntity *endpointConfigEntity) error {

	//Orderers Config
	for orderer, ordererConfig := range configEntity.Orderers {
		//resolve paths
		ordererConfig.TLSCACerts.Path = pathvar.Subst(ordererConfig.TLSCACerts.Path)
		//pre load key and cert bytes
		err := ordererConfig.TLSCACerts.LoadBytes()
		if err != nil {
			return errors.WithMessage(err, "failed to load orderer cert")
		}
		configEntity.Orderers[orderer] = ordererConfig
	}

	//Peer Config
	for peer, peerConfig := range configEntity.Peers {
		//resolve paths
		peerConfig.TLSCACerts.Path = pathvar.Subst(peerConfig.TLSCACerts.Path)
		//pre load key and cert bytes
		err := peerConfig.TLSCACerts.LoadBytes()
		if err != nil {
			return errors.WithMessage(err, "failed to load peer cert")
		}
		configEntity.Peers[peer] = peerConfig
	}

	return nil
}
7472
func WithEndpointConfig(endpointConfigs ...interface{}) Option {
	return func(opts *options) error {
		c, err := fabImpl.BuildConfigEndpointFromOptions(endpointConfigs...)
		if err != nil {
			return err
		}
		opts.endpointConfig = c
		return nil
	}
}