code: func NewClient(cfg *config.Config) *Client {
  	rt := &apiRoundTripper{
  		DefaultRequestDoer: registry.DefaultRequestDoer{
  			Client: &http.Client{
  				Transport: newTransport(cfg),
  
  				// The client can trust the daemon to do the right thing and
  				// cancel appropriately. Therefore, we only care about a
  				// connection timeout, not a request timeout.
  				Timeout: 0,
  			},
  			Host: "http://localhost",
  		},
  	}
  
  	c := &Client{Client: *registry.NewClientWithRoundTripper(rt)}
  
  	c.Users = newUsersClient(c.Client.Users, rt)
  	c.Machines = newMachinesClient(c.Client.Machines, rt)
  	c.KeyPairs = newKeyPairsClient(c.Client.KeyPairs, rt)
  	c.OrgInvites = newOrgInvitesClient(c.Client.OrgInvites, rt)
  	c.Version = newVersionClient(c.Client.Version, rt)
  
  	c.Session = &SessionClient{client: rt}
  	c.Credentials = &CredentialsClient{client: rt}
  	c.Worklog = &WorklogClient{client: rt}
  	c.Updates = &UpdatesClient{client: rt}
  
  	return c
  }
docs: // NewClient returns a new Client.