Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
captchanjack committed Jun 4, 2021
0 parents commit c0f4fa8
Show file tree
Hide file tree
Showing 29 changed files with 1,520 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: TagBot
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
24 changes: 24 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Documentation

on:
push:
branches:
- master
tags: '*'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: '1.5'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
run: julia --project=docs/ docs/make.jl
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Files generated by invoking Julia with --code-coverage
*.jl.cov
*.jl.*.cov

# Files generated by invoking Julia with --track-allocation
*.jl.mem

# System-specific files and directories generated by the BinaryProvider and BinDeps packages
# They contain absolute paths specific to the host computer, and so should not be committed
deps/deps.jl
deps/build.log
deps/downloads/
deps/usr/
deps/src/

# Build artifacts for creating documentation generated by the Documenter package
docs/build/
docs/site/

# File generated by Pkg, the package manager, based on a corresponding Project.toml
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 captchanjack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: test
test:
@docker run --name redis -d -p 6379:6379 -e ALLOW_EMPTY_PASSWORD=yes bitnami/redis:6.2.3
@julia -e "using Pkg; Pkg.test()"
@docker stop redis
@docker rm redis
@docker image rm bitnami/redis:6.2.3
10 changes: 10 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name = "Jedis"
uuid = "b89ccfe0-2c5f-46f6-b89b-da3e1c2e286f"
authors = ["Jack Chan <[email protected]>"]
version = "0.1.0"

[deps]
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"

[compat]
julia = "^1"
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Jedis.jl
A lightweight Redis client, implemented in Julia.

## Key Features
This client supports:
- Basic **[command execution](https://captchanjack.github.io/Jedis.jl/commands/)**
- Executing commands with a **[global client](https://captchanjack.github.io/Jedis.jl/client/)** instance
- Executing commands atomically per client instance, with the help of socket locks
- **[Pipelining](https://captchanjack.github.io/Jedis.jl/pipeline/)**
- **[Transactions](https://captchanjack.github.io/Jedis.jl/commands/#Jedis.multi)**
- **[Pub/Sub](https://captchanjack.github.io/Jedis.jl/pubsub/)**
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
site/
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
20 changes: 20 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Documenter
using Jedis

makedocs(
sitename="Jedis.jl Documentation",
# format = Documenter.HTML(prettyurls = false),
pages=[
"Home" => "index.md",
"Client" => "client.md",
"Commands" => "commands.md",
"Pipelining" => "pipeline.md",
"Pub/Sub" => "pubsub.md"
],
modules=[Jedis]
)

deploydocs(
repo="https://github.com/captchanjack/Jedis.jl.git",
devurl="docs"
)
16 changes: 16 additions & 0 deletions docs/src/client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Redis Client Connection

```@docs
Client
execute(command::AbstractArray, client::Client)
Jedis.GLOBAL_CLIENT
set_global_client
get_global_client
Jedis.copy
disconnect!
reconnect!
wait_until_subscribed
wait_until_unsubscribed
wait_until_channel_unsubscribed
wait_until_pattern_unsubscribed
```
40 changes: 40 additions & 0 deletions docs/src/commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Redis Commands

Jedis commands all share a common interface, if the `client` kwarg is not provided then the [`Jedis.GLOBAL_CLIENT`](@ref) instance will be used:

```@example
command(args...; kwargs..., client=get_global_client())
```

### Full list of Jedis commands:

```@docs
auth
select
ping
flushdb
flushall
quit
set
Jedis.get
del
setex
expire
ttl
multi
exec
multi_exec
hset
hget
hgetall
hmget
hdel
lpush
rpush
lpop
rpop
blpop
brpop
llen
lrange
```
11 changes: 11 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Jedis.jl
A lightweight Redis client, implemented in Julia.

## Key Features
This client supports:
- Basic **[command execution](https://captchanjack.github.io/Jedis.jl/commands/)**
- Executing commands with a **[global client](https://captchanjack.github.io/Jedis.jl/client/)** instance
- Executing commands atomically per client instance, with the help of socket locks
- **[Pipelining](https://captchanjack.github.io/Jedis.jl/pipeline/)**
- **[Transactions](https://captchanjack.github.io/Jedis.jl/commands/#Jedis.multi)**
- **[Pub/Sub](https://captchanjack.github.io/Jedis.jl/pubsub/)**
9 changes: 9 additions & 0 deletions docs/src/pipeline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Pipelining

```@docs
Pipeline
add!
execute(command::AbstractArray, pipe::Pipeline)
execute(pipe::Pipeline; filter_multi_exec=true)
pipeline
```
9 changes: 9 additions & 0 deletions docs/src/pubsub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Pub/Sub

```@docs
publish
subscribe
unsubscribe
psubscribe
punsubscribe
```
21 changes: 21 additions & 0 deletions src/Jedis.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Jedis

export Client, Pipeline, RedisError, get_global_client, set_global_client, disconnect!, reconnect!,
add!, copy, wait_until_subscribed, wait_until_unsubscribed, wait_until_channel_unsubscribed,
wait_until_pattern_unsubscribed, execute, auth, select, ping, flushdb, flushall, quit,
set, get, del, setex, expire, ttl, multi, exec, multi_exec, pipeline, hset, hget, hgetall,
hmget, hdel, rpush, lpush, lpop, rpop, blpop, brpop, llen, lrange, publish, subscribe,
unsubscribe, psubscribe, punsubscribe

using Sockets

include("exceptions.jl")
include("utilities.jl")
include("client.jl")
include("pipeline.jl")
include("protocol.jl")
include("execute.jl")
include("commands.jl")
include("pubsub.jl")

end # module
Loading

2 comments on commit c0f4fa8

@captchanjack
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/38075

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" c0f4fa8503456da6af4122b9ea5de5c42adc1716
git push origin v0.1.0

Please sign in to comment.