Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example please #1

Open
ghost opened this issue Mar 9, 2021 · 3 comments
Open

Example please #1

ghost opened this issue Mar 9, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 9, 2021

Hi, can i get some examples?

@Oozlum
Copy link
Owner

Oozlum commented Mar 10, 2021

Hi,

I have just updated the README.md with documentation for the library. I still need to document the last (highest level) module and include examples, which I will try to get done tomorrow. You can look at the tests for more information in the meantime.

Here are a couple of simple examples to give you the gist of it:

local redis = require'redis-client'

local client = redis.connect('localhost', 6379)
local resp = client:ping()
--[[
returns {
  type = redis.response.STATUS,
  data = 'PONG',
}
--]]

resp = client:get('string')
--[[
returns {
  type = redis.response.STRING,
  data = 'My string',
}
--]]

resp = client:lrange('list', 0, -1)
--[[
returns {
  type = redis.response.ARRAY,
  data = {
    { type = redis.response.STRING, data = 'list entry 1' },
    { type = redis.response.STRING, data = 'list entry 2' },
  },
}
--]]

@ghost
Copy link
Author

ghost commented Mar 10, 2021

Thank you! 🥰

@Oozlum
Copy link
Owner

Oozlum commented Mar 12, 2021

I've finished the documentation in README.md, but have yet to write some examples. Comments welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant