github.com/aporeto-inc/trireme-lib@v10.358.0+incompatible/monitor/remoteapi/client/client_windows.go (about)

     1  // +build windows
     2  
     3  package client
     4  
     5  import (
     6  	"context"
     7  	"net"
     8  
     9  	"gopkg.in/natefinch/npipe.v2"
    10  )
    11  
    12  // Client is an api client structure.
    13  type Client struct {
    14  	pipeName string
    15  }
    16  
    17  // NewClient creates a new client.
    18  func NewClient(path string) (*Client, error) {
    19  	return &Client{pipeName: `\\.\pipe\` + path}, nil
    20  }
    21  
    22  func (c *Client) getDialContext() dialContextFunc {
    23  	return func(_ context.Context, _, _ string) (net.Conn, error) {
    24  		return npipe.Dial(c.pipeName)
    25  	}
    26  }