// ProtocolOption sets the Protocol Tag associated to the libp2p roundtripper.
167877
func ProtocolOption(p protocol.ID) Option {
	return func(o *options) {
		o.Protocol = p
	}
}
632983
func WithPeerResolver(value peerresolver.Provider) options.Opt {
	return func(p options.Params) {
		if setter, ok := p.(peerResolverSetter); ok {
			setter.SetPeerResolver(value)
		}
	}
}
28623
func (s *Ethereum) Protocols() []p2p.Protocol {
	if s.lesServer == nil {
		return s.protocolManager.SubProtocols
	}
	return append(s.protocolManager.SubProtocols, s.lesServer.Protocols()...)
}
416442
func setEndpointConfigWithOptionInterface(c *EndpointConfigOptions, o interface{}) error {
	s := &setter{}

	s.set(c.timeout, func() bool { _, ok := o.(timeout); return ok }, func() { c.timeout = o.(timeout) })
	s.set(c.orderersConfig, func() bool { _, ok := o.(orderersConfig); return ok }, func() { c.orderersConfig = o.(orderersConfig) })
	s.set(c.ordererConfig, func() bool { _, ok := o.(ordererConfig); return ok }, func() { c.ordererConfig = o.(ordererConfig) })
	s.set(c.peersConfig, func() bool { _, ok := o.(peersConfig); return ok }, func() { c.peersConfig = o.(peersConfig) })
	s.set(c.peerConfig, func() bool { _, ok := o.(peerConfig); return ok }, func() { c.peerConfig = o.(peerConfig) })
	s.set(c.networkConfig, func() bool { _, ok := o.(networkConfig); return ok }, func() { c.networkConfig = o.(networkConfig) })
	s.set(c.networkPeers, func() bool { _, ok := o.(networkPeers); return ok }, func() { c.networkPeers = o.(networkPeers) })
	s.set(c.channelConfig, func() bool { _, ok := o.(channelConfig); return ok }, func() { c.channelConfig = o.(channelConfig) })
	s.set(c.channelPeers, func() bool { _, ok := o.(channelPeers); return ok }, func() { c.channelPeers = o.(channelPeers) })
	s.set(c.channelOrderers, func() bool { _, ok := o.(channelOrderers); return ok }, func() { c.channelOrderers = o.(channelOrderers) })
	s.set(c.tlsCACertPool, func() bool { _, ok := o.(tlsCACertPool); return ok }, func() { c.tlsCACertPool = o.(tlsCACertPool) })
	s.set(c.tlsClientCerts, func() bool { _, ok := o.(tlsClientCerts); return ok }, func() { c.tlsClientCerts = o.(tlsClientCerts) })
	s.set(c.cryptoConfigPath, func() bool { _, ok := o.(cryptoConfigPath); return ok }, func() { c.cryptoConfigPath = o.(cryptoConfigPath) })

	if !s.isSet {
		return errors.Errorf("option %#v is not a sub interface of EndpointConfig, at least one of its functions must be implemented.", o)
	}

	return nil
}
683500
func (c *Connection) Protocol() string {
	c.protoLock.Lock()
	defer c.protoLock.Unlock()
	return c.protocol
}
471703
func ProxyOption() ServeOption {
	return func(ipfsNode *core.IpfsNode, _ net.Listener, mux *http.ServeMux) (*http.ServeMux, error) {
		mux.HandleFunc("/p2p/", func(w http.ResponseWriter, request *http.Request) {
			// parse request
			parsedRequest, err := parseRequest(request)
			if err != nil {
				handleError(w, "failed to parse request", err, 400)
				return
			}

			request.Host = "" // Let URL's Host take precedence.
			request.URL.Path = parsedRequest.httpPath
			target, err := url.Parse(fmt.Sprintf("libp2p://%s", parsedRequest.target))
			if err != nil {
				handleError(w, "failed to parse url", err, 400)
				return
			}

			rt := p2phttp.NewTransport(ipfsNode.PeerHost, p2phttp.ProtocolOption(parsedRequest.name))
			proxy := httputil.NewSingleHostReverseProxy(target)
			proxy.Transport = rt
			proxy.ServeHTTP(w, request)
		})
		return mux, nil
	}
}
364124
func (p *Path) SaveOptional(via interface{}, tag string) *Path {
	np := p.clone()
	np.stack = append(np.stack, saveOptionalMorphism(via, tag))
	return np
}
1104255
func (pr *peerRing) Choose(_ context.Context, _ *transport.Request) peer.StatusPeer {
	if pr.nextNode == nil {
		return nil
	}

	p := getPeerForRingNode(pr.nextNode)
	pr.nextNode = pr.nextNode.Next()

	return p
}
853283
func (s *DescribeAvailabilityOptionsOutput) SetAvailabilityOptions(v *AvailabilityOptionsStatus) *DescribeAvailabilityOptionsOutput {
	s.AvailabilityOptions = v
	return s
}
729641
func Options(opts ...grpc.ServerOption) server.Option {
	return func(o *server.Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, grpcOptions{}, opts)
	}
}
241418
func (s *ClusterMetadata) SetShippingOption(v string) *ClusterMetadata {
	s.ShippingOption = &v
	return s
}
1258157
func (n *NIC) AddAddressWithOptions(protocol tcpip.NetworkProtocolNumber, addr tcpip.Address, peb PrimaryEndpointBehavior) *tcpip.Error {
	// Add the endpoint.
	n.mu.Lock()
	_, err := n.addAddressLocked(protocol, addr, peb, false)
	n.mu.Unlock()

	return err
}
559318
func (s *EncryptionConfiguration) SetEncryptionOption(v string) *EncryptionConfiguration {
	s.EncryptionOption = &v
	return s
}
112441
func SupportedOption(option uint16) bool {
	sup.RLock()
	_, ok := sup.m[option]
	sup.RUnlock()
	return ok
}
1091385
func (s *ParameterStringFilter) SetOption(v string) *ParameterStringFilter {
	s.Option = &v
	return s
}
345294
func (self *ConnectionString) Protocol(defaults ...string) string {

	if _, protocol := self.Scheme(); protocol != `` {
		return protocol
	} else if len(defaults) > 0 {
		return defaults[0]
	} else {
		return ``
	}
}
924380
func (spec *ConnectionSpec) Protocol(protocol Protocol) *ConnectionSpec {
	spec.protocol = protocol
	return spec
}