Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for NewClient (0.38 sec)

  1. internal/logger/target/kafka/kafka_scram_client_contrib.go

    // SASLprep fails, the method returns an error.
    func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error) {
    	x.Client, err = x.HashGeneratorFcn.NewClient(userName, password, authzID)
    	if err != nil {
    		return err
    	}
    	x.ClientConversation = x.Client.NewConversation()
    	return nil
    }
    
    // Step takes a string provided from a server (or just an empty string for the
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Nov 09 04:04:01 GMT 2023
    - 3.3K bytes
    - Viewed (1)
  2. internal/dsync/dsync-client_test.go

    type ReconnectRESTClient struct {
    	u    *url.URL
    	rest *rest.Client
    }
    
    // newClient constructs a ReconnectRESTClient object with addr and endpoint initialized.
    // It _doesn't_ connect to the remote endpoint. See Call method to see when the
    // connect happens.
    func newClient(endpoint string) NetLocker {
    	u, err := url.Parse(endpoint)
    	if err != nil {
    		panic(err)
    	}
    
    	tr := &http.Transport{
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Jan 20 17:36:09 GMT 2022
    - 4.4K bytes
    - Viewed (0)
  3. internal/event/target/kafka.go

    	target.config = config
    
    	brokers := []string{}
    	for _, broker := range args.Brokers {
    		brokers = append(brokers, broker.String())
    	}
    
    	client, err := sarama.NewClient(brokers, config)
    	if err != nil {
    		if !errors.Is(err, sarama.ErrOutOfBrokers) {
    			target.loggerOnce(context.Background(), err, target.ID().String())
    		}
    		return err
    	}
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Feb 20 08:16:35 GMT 2024
    - 13K bytes
    - Viewed (0)
  4. internal/rest/client.go

    	}
    	return resp.Body, nil
    }
    
    // Close closes all idle connections of the underlying http client
    func (c *Client) Close() {
    	atomic.StoreInt32(&c.connected, closed)
    }
    
    // NewClient - returns new REST client.
    func NewClient(uu *url.URL, tr http.RoundTripper, newAuthToken func(aud string) string) *Client {
    	connected := int32(online)
    	urlStr := uu.String()
    	u, err := url.Parse(urlStr)
    	if err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 14.4K bytes
    - Viewed (0)
  5. cmd/peer-rest-client.go

    	}
    
    	serverURL := &url.URL{
    		Scheme: scheme,
    		Host:   peer.String(),
    		Path:   peerRESTPath,
    	}
    
    	restClient := rest.NewClient(serverURL, globalInternodeTransport, newCachedAuthToken())
    	// Use a separate client to avoid recursive calls.
    	healthClient := rest.NewClient(serverURL, globalInternodeTransport, newCachedAuthToken())
    	healthClient.NoMetrics = true
    
    	// Construct a new health function.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 25.8K bytes
    - Viewed (0)
  6. internal/event/target/mqtt.go

    		SetMaxReconnectInterval(args.MaxReconnectInterval).
    		SetKeepAlive(args.KeepAlive).
    		SetTLSConfig(&tls.Config{RootCAs: args.RootCAs}).
    		AddBroker(args.Broker.String())
    
    	target.client = mqtt.NewClient(options)
    
    	token := target.client.Connect()
    	ok := token.WaitTimeout(reconnectInterval)
    	if !ok {
    		return store.ErrNotConnected
    	}
    	if token.Error() != nil {
    		return token.Error()
    	}
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat Oct 07 15:07:38 GMT 2023
    - 8.2K bytes
    - Viewed (0)
  7. cmd/storage-rest-client.go

    		Host:   endpoint.Host,
    		Path:   path.Join(storageRESTPrefix, endpoint.Path, storageRESTVersion),
    	}
    
    	restClient := rest.NewClient(serverURL, globalInternodeTransport, newCachedAuthToken())
    
    	if healthCheck {
    		// Use a separate client to avoid recursive calls.
    		healthClient := rest.NewClient(serverURL, globalInternodeTransport, newCachedAuthToken())
    		healthClient.NoMetrics = true
    		restClient.HealthCheckFn = func() bool {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 26.1K bytes
    - Viewed (0)
  8. internal/dsync/dsync_test.go

    func TestMain(m *testing.M) {
    	startLockServers()
    
    	// Initialize locker clients for dsync.
    	var clnts []NetLocker
    	for i := 0; i < len(nodes); i++ {
    		clnts = append(clnts, newClient(nodes[i].URL))
    	}
    
    	ds = &Dsync{
    		GetLockers: func() ([]NetLocker, string) { return clnts, uuid.New().String() },
    		Timeouts: Timeouts{
    			Acquire:         testDrwMutexAcquireTimeout,
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat Dec 24 03:49:07 GMT 2022
    - 11K bytes
    - Viewed (0)
  9. internal/logger/target/kafka/kafka.go

    	h.config = sconfig
    
    	var brokers []string
    	for _, broker := range h.kconfig.Brokers {
    		brokers = append(brokers, broker.String())
    	}
    
    	client, err := sarama.NewClient(brokers, sconfig)
    	if err != nil {
    		return err
    	}
    
    	producer, err := sarama.NewSyncProducerFromClient(client)
    	if err != nil {
    		return err
    	}
    	h.client = client
    	h.producer = producer
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 10.1K bytes
    - Viewed (1)
  10. internal/event/target/elasticsearch.go

    	}
    	// Set basic auth
    	if args.Username != "" && args.Password != "" {
    		elasticConfig.Username = args.Username
    		elasticConfig.Password = args.Password
    	}
    	// Create a client
    	client, err := elasticsearch7.NewClient(elasticConfig)
    	if err != nil {
    		return nil, err
    	}
    	clientV7 := &esClientV7{client}
    	return clientV7, nil
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 15K bytes
    - Viewed (0)
Back to top