redis_lib/

directory
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2017 License: Apache-2.0

README

Examples for cn-infra/db/keyval/redis

Get Started

To run these examples, you must have access to a Redis installation, either locally or remotely.

You can download docker images from:

Modify API configuration to match your environment. See sample configurations to use with the API here:

Simple Example

  • Straight API calls, no particular scenario
  • Also, look at the function generateSampleConfigs() which shows how to generate and save each type of client configurations.

To start the example, 'cd' to cn-infra/db/keyval/redis/examples directory. Run

go run simple/simple.go -redis-config=<redis client config yaml>

Airport Example

  • Simulates airport operations with four functional modules - arrival, departure, runway and hangar
  • Communicates and updates flight info through Redis.
  • Displays flight status, live.

diagram.png


To start the example, 'cd' to cn-infra/db/keyval/redis/examples directory. Run

go run airport/airport.go -redis-config=<redis client config yaml>

Known Issues

  • When working with Redis Cluster:

    Redis Multi-key commands, like MGET, KEYS, SCAN, PUBSCRIBE...etc. do not work unless all keys involved belong to the same hash slot. This API uses all of these commmands. If you have to use Redis Cluster, you can force all keys to be stored in the same hash slot by using "hash tag".

Directories

Path Synopsis
model
Package flight is a generated protocol buffer package.
Package flight is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL