Clean up README a bit

This commit is contained in:
Justin Li 2013-08-13 01:41:45 -04:00
parent dcc2621ec3
commit 2cd4d49265

View file

@ -1,37 +1,69 @@
#chihaya [![Build Status](https://travis-ci.org/pushrax/chihaya.png?branch=master)](https://travis-ci.org/pushrax/chihaya)
# Chihaya [![Build Status](https://travis-ci.org/pushrax/chihaya.png?branch=master)](https://travis-ci.org/pushrax/chihaya)
chihaya is a high-performance [BitTorrent tracker](http://en.wikipedia.org/wiki/BitTorrent_tracker) written in the Go programming language. It isn't quite ready for prime-time just yet, but these are the features that it targets:
Chihaya is a high-performance [BitTorrent tracker](http://en.wikipedia.org/wiki/BitTorrent_tracker)
written in the Go programming language. It isn't quite ready for prime-time
just yet, but these are the features it targets:
- Requests are multiplexed over all available threads (1 goroutine per request)
- Low processing and memory footprint
- Low resource consumption
- *Fast* request processing
- IPv6 support
- Generic storage interface that can be easily adapted to use any data store
- Scaling properties that directly correlate with the chosen data store's scaling properties
- A generic storage interface that is easily adapted to use any data store
- Scaling properties that directly correlate with a chosen data store's scaling
properties
##installing
## Installing
```sh
$ go install github.com/pushrax/chihaya
```
First, you'll need to install libzmq with your favourite package manager. Then,
##configuring
```sh $ go install github.com/pushrax/chihaya ```
Configuration is done in a JSON formatted file specified with the `-config` flag. An example configuration can be seen in the `exampleConfig` variable of [`config/config_test.go`](https://github.com/pushrax/chihaya/blob/master/config/config_test.go).
## Configuring
##out of the box drivers
Configuration is done in a JSON formatted file specified with the `-config`
flag. An example configuration can be seen in the `exampleConfig` variable of
[`config/config_test.go`](https://github.com/pushrax/chihaya/blob/master/config/config_test.go).
## Default storage drivers
Chihaya currently supports the following drivers out of the box:
* [redis](http://redis.io)
##implementing custom storage
## Implementing custom storage drivers
The [`storage`](http://godoc.org/github.com/pushrax/chihaya/storage) package is heavily inspired by the standard library's [`database/sql`](http://godoc.org/database/sql) package. To write a new storage backend, create a new Go package that has an implementation of the [`DS`](http://godoc.org/github.com/pushrax/chihaya/storage#DS), [`Tx`](http://godoc.org/github.com/pushrax/chihaya/storage#Tx), and [`Driver`](http://godoc.org/github.com/pushrax/chihaya/storage#Driver) interfaces. Within that package, you must also define an [`func init()`](http://golang.org/ref/spec#Program_execution) that calls [`storage.Register("driverName", &myDriver{})`](http://godoc.org/github.com/pushrax/chihaya/storage#Register). Please read the documentation and understand these interfaces as there are assumptions about thread-safety. After you've implemented a new driver, all you have to do is remember to add `import _ path/to/your/library` to the top of any file (preferably `main.go`) and the side effects from `func init()` will globally register your driver so that config files will recognize your driver by name. If you're writing a driver for a popular data store, consider contributing it.
The [`storage`] package is heavily inspired by the standard library's
[`database/sql`] package. To write a new storage backend, create a new Go
package that has an implementation of the [`DS`], [`Tx`], and [`Driver`]
interfaces. Within that package, you must also define an [`init()`] that calls
[`storage.Register("driverName", &myDriver{})`].
[`storage`]: http://godoc.org/github.com/pushrax/chihaya/storage
[`database/sql`]: http://godoc.org/database/sql
[`DS`]: http://godoc.org/github.com/pushrax/chihaya/storage#DS
[`Tx`]: http://godoc.org/github.com/pushrax/chihaya/storage#Tx
[`Driver`]: http://godoc.org/github.com/pushrax/chihaya/storage#Driver
[`init()`]: http://golang.org/ref/spec#Program_execution
[`storage.Register("driverName", &myDriver{})`]: http://godoc.org/github.com/pushrax/chihaya/storage#Register.
Please read the documentation and understand these interfaces as there are
assumptions made about thread-safety. After you've implemented a new driver,
all you have to do is remember to add `import _ path/to/your/library` to the
top of any file (preferably `main.go`) and the side effects from `func init()`
will globally register your driver so that config files will recognize your
driver by name. If you're writing a driver for a popular data store, consider
contributing it.
##contributing
## Contributing
If you're interested in contributing, please contact us in **#chihaya on [freenode](http://freenode.net/)**([webchat](http://webchat.freenode.net?channels=chihaya)) or post to the issue tracker. Please don't offer massive pull requests with no prior communication attempts as it will most likely lead to confusion and time wasted for everyone. However, small unannounced fixes are welcome.
If you're interested in contributing, please contact us in **#chihaya on
[freenode]** ([webchat]) or post to the issue tracker. Please don't offer
massive pull requests with no prior communication attempts as it will most
likely lead to confusion and time wasted for everyone. However, small
unannounced fixes are always welcome.
[freenode]: http://freenode.net
[webchat]: http://webchat.freenode.net?channels=chihaya
And remember: good gophers always use gofmt!