Setting up client libraries

This page shows how to install client libraries for the Memorystore for Memcached API so you can connect to the API with the language of your choice.

Installing the client library

C++

See Setting up a C++ development environment for details about this client library's requirements and install dependencies.

C#

Install the Google.Cloud.Memcache.V1Beta2 package in Visual Studio. See the Google Cloud .NET Memcached Installation documentation for more details.

Go

go get cloud.google.com/go/memcache/apiv1beta2

Java

If you are using Maven with BOM, add this to your pom.xml file

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>libraries-bom</artifactId>
      <version>20.8.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>
 
<dependencies>
  <dependency>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-memcache</artifactId>
  </dependency>

If you are using Maven without BOM, add this to your dependencies:

<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-memcache</artifactId>
  <version>0.2.1</version>
</dependency>

If you are using Gradle, add this to your dependencies:

  compile 'com.google.cloud:google-cloud-memcache:0.2.1'

If you are using SBT, add this to your dependencies:

  libraryDependencies += "com.google.cloud" % "google-cloud-memcache" % "0.2.1"

Node.js

npm install @google-cloud/memcache

Python

For more on setting up your Python development environment, refer to Python Development Environment Setup Guide.

Mac/Linux
pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-memcache
Windows
pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-memcache

Setting up authentication

  1. Install and initialize the gcloud CLI.

    When you initialize the gcloud CLI, be sure to specify a Google Cloud project in which you have permission to access the resources your application needs.

  2. Configure ADC:

    gcloud auth application-default login

    A sign-in screen appears. After you sign in, your credentials are stored in the local credential file used by ADC.

Additional Resources