Skip to content

gbagnoli/glock

Repository files navigation

glock

Build Status GoDoc

Package glock implements locking against a variety of backends for the Go programming language.

glock is released under the MIT license.

WARN: this package is under heavy development, API is not stable yet.

Backends

  • Redis

    Simple Redis implementation. Requires redis >= 2.6 as it uses lua scripting.
    This implementation is safe only if used againt a single master, with no replication.

  • Cassandra

    Cassandra implementation, inspired by datastax's "Consensus on Cassandra" blogpost.
    Requires cassandra >= 2.0 as it uses lightweight transactions.

  • Memory

    Naive in-process implementation, only useful for testing.

Installation

go get gopkg.in/gbagnoli/glock.v1

Tests

By default, tests runs only using the memory driver. To run test for one or more specific backend, use build tags.

go test -tags="redis cassandra"

Roadmap

  1. Add more tests
  2. Add more documentation
  3. Add more backends (in no particular order)
  1. Stabilize interface.

Example

See glock-example

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published