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 the Google Cloud CLI, then initialize it by running the following command:

    gcloud init
  2. If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    You don't need to do this if you're using Cloud Shell.

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

Additional Resources