// GetClient loads the client by id
427384
func (s *Storage) GetClient(id string) (osin.Client, error) {
	row := s.db.QueryRow("SELECT id, secret, redirect_uri, extra FROM client WHERE id=$1", id)
	var c osin.DefaultClient
	var extra string

	if err := row.Scan(&c.Id, &c.Secret, &c.RedirectUri, &extra); err == sql.ErrNoRows {
		return nil, pkg.ErrNotFound
	} else if err != nil {
		return nil, errors.New(err)
	}
	c.UserData = extra
	return &c, nil
}
1354589
func (b *Birc) getClient() (*girc.Client, error) {
	server, portstr, err := net.SplitHostPort(b.GetString("Server"))
	if err != nil {
		return nil, err
	}
	port, err := strconv.Atoi(portstr)
	if err != nil {
		return nil, err
	}
	// fix strict user handling of girc
	user := b.GetString("Nick")
	for !girc.IsValidUser(user) {
		if len(user) == 1 || len(user) == 0 {
			user = "matterbridge"
			break
		}
		user = user[1:]
	}

	i := girc.New(girc.Config{
		Server:     server,
		ServerPass: b.GetString("Password"),
		Port:       port,
		Nick:       b.GetString("Nick"),
		User:       user,
		Name:       b.GetString("Nick"),
		SSL:        b.GetBool("UseTLS"),
		TLSConfig:  &tls.Config{InsecureSkipVerify: b.GetBool("SkipTLSVerify"), ServerName: server}, //nolint:gosec
		PingDelay:  time.Minute,
	})
	return i, nil
}
1339732
func GetClients(query map[string]string, lastModifiedSince string) (*Clients, string, error) {
	clients := new(Clients)

	if lastModified, err := executeRequest("clients", query, lastModifiedSince, &clients); err != nil {
		return nil, "", err
	} else {
		return clients, lastModified, nil
	}
}
761390
func GetClient(ctx context.Context) *Client {
	c, ok := ctx.Value(ctxKeyClient).(*Client)
	if !ok {
		return nil
	}
	return c
}
967847
func NewClient(opts ClientOptions) (*Client, error) {
	err := opts.ensure()
	if err != nil {
		return nil, err
	}

	return &Client{
		logger: log.Get(PkgName),
		opts:   opts,
	}, nil
}
523572
func (c *KopsV1alpha2Client) RESTClient() rest.Interface {
	if c == nil {
		return nil
	}
	return c.restClient
}
674842
func (a *AuthorizationApp) GetClientID() string {
	if a == nil || a.ClientID == nil {
		return ""
	}
	return *a.ClientID
}
942722
func HTTPClient(client *http.Client) Option {
	return func(c *Client) error {
		c.httpClient = client
		return nil
	}
}
260976
func (b *Backend) getClient() *gomemcache.Client {
	if b.client == nil {
		b.client = gomemcache.New(b.servers...)
	}
	return b.client
}
810343
func (cs ClientsService) GetToken(id, secret string) (string, error) {
	resp, err := newNetworkClient(cs.config).MakeRequest(network.Request{
		Method:        "POST",
		Path:          "/oauth/token",
		Authorization: network.NewBasicAuthorization(id, secret),
		Body: network.NewFormRequestBody(url.Values{
			"client_id":  []string{id},
			"grant_type": []string{"client_credentials"},
		}),
		AcceptableStatusCodes: []int{http.StatusOK},
	})
	if err != nil {
		return "", translateError(err)
	}

	var response documents.TokenResponse
	err = json.Unmarshal(resp.Body, &response)
	if err != nil {
		return "", MalformedResponseError{err}
	}

	return response.AccessToken, nil
}
76990
func GetClient() (kubernetes.Interface, error) {
	loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
	configOverrides := &clientcmd.ConfigOverrides{}
	kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides)
	config, err := kubeConfig.ClientConfig()
	if err != nil {
		return nil, fmt.Errorf("Error creating kubeConfig: %v", err)
	}
	client, err := kubernetes.NewForConfig(config)
	if err != nil {
		return nil, errors.Wrap(err, "Error creating new client from kubeConfig.ClientConfig()")
	}
	return client, nil
}
360955
func (m *MockRequester) GetClient() fosite.Client {
	ret := m.ctrl.Call(m, "GetClient")
	ret0, _ := ret[0].(fosite.Client)
	return ret0
}
961571
func (e *ApiClientService) GetKey(clientName string, keyName string) (data *ApiClientKey, err error) {
	url := fmt.Sprintf("clients/%s/keys/%s", clientName, keyName)
	err = e.client.magicRequestDecoder("GET", url, nil, &data)
	return
}
1137719
func GetClientURL(localEndpoint *kubeadmapi.APIEndpoint) string {
	return "https://" + net.JoinHostPort(localEndpoint.AdvertiseAddress, strconv.Itoa(constants.EtcdListenClientPort))
}
1058593
func getClient(c context.Context) crimson.CrimsonClient {
	return c.Value(&clientKey).(crimson.CrimsonClient)
}
1049706
func (settings EnvironmentSettings) getClientAndTenant() (string, string) {
	clientID := settings.Values[ClientID]
	tenantID := settings.Values[TenantID]
	return clientID, tenantID
}
614685
func GetClient(tripperFactory common.TripperFactory, creds *common.Credentials, provider common.Provider) (*http.Client, error) {

	tripper, tripperErr := tripperFactory.NewTripper(creds, provider)

	if tripperErr != nil {
		return nil, tripperErr
	}

	return &http.Client{Transport: tripper}, nil
}