Giter Club home page Giter Club logo

redis-client's Introduction

golang 实现redis-client

背景

最近在熟悉redis相关命令,此次学习一下redis clientredis server如何通信

Redis-ClientReids-Server如何通信

redis-server与redis-client通过tcp连接进行数据交互,服务端默认端口号为6379,并且客户端和服务器发送的命令一律以\r\n(CRLF)结束

请求协议

redis请求协议,在这个协议中,所有发至服务器的参数都是二进制安全的.

* <参数数量>
$<参数1的字节数量> CRLF
<参数1的数据> CRLF

比如:实现redis get keys操作如下:

*2
$3
get
$4
keys
回复协议
  • 状态回复status reply的第一个字节是+
  • 错误回复error reply的第一个字节是-

redis-client

redis-client's People

Contributors

wenruige avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.