messagedb

package module
v0.0.0-...-4471eec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2015 License: MIT Imports: 4 Imported by: 0

README

DON'T USE THIS. WORK IN PROGRESS

messageDB

Build Status

Installing Go

MessageDB requires Go 1.4.2 or greater.

At MessageDB we find gvm, a Go version manager, useful for installing Go. For instructions on how to install it see the gvm page on github.

After installing gvm you can install and set the default go version by running the following:

gvm install go1.4.2
gvm use go1.4.2 --default

Project structure

First you need to setup the project structure:

export GOPATH=$HOME/gocodez
mkdir -p $GOPATH/src/github.com/messagedb
cd $GOPATH/src/github.com/messagedb
git clone git@github.com:messagedb/messagedb

You can add the line export GOPATH=$HOME/gocodez to your bash/zsh file to be set for every shell instead of having to manually run it everytime.

We have a pre commit hook to make sure code is formatted properly and vetted before you commit any changes. We strongly recommend using the pre commit hook to guard against accidentally committing unformatted code. To use the pre-commit hook, run the following:

cd $GOPATH/src/github.com/messagedb/messagedb
cp .hooks/pre-commit .git/hooks/

In case the commit is rejected because it's not formatted you can run the following to format the code:

go fmt ./...
go vet ./...

To install go vet, run the following command:

go get golang.org/x/tools/cmd/vet

To install jsonenums, run the following command:

go get github.com/campoy/jsonenums

To install support for protobuf generation, run the following command:

go get github.com/gogo/protobuf/proto
go get github.com/gogo/protobuf/protoc-gen-gogo
go get github.com/gogo/protobuf/gogoproto

To install statik, run the following command:

go get github.com/rakyll/statik

Build and Test

Make sure you have Go installed and the project structure as shown above. To then build the project, execute the following commands:

cd $GOPATH/src/github.com/messagedb
go get -u -f -t ./...
statik -src=./web/admin
go build ./...

To then install the binaries, run the following command. They can be found in $GOPATH/bin. Please note that the MessageDB binary is named messagedbd, not messagedb.

go install ./...

To set the version and commit flags during the build pass the following to the build command:

-ldflags="-X main.version $VERSION -X main.commit $COMMIT"

where $VERSION is the version, and $COMMIT is the git commit hash.

To run the tests, execute the following command:

cd $GOPATH/src/github.com/messagedb/messagedb
go test -v ./...

# run tests that match some pattern
go test -run=TestDatabase . -v

# run tests and show coverage
go test -coverprofile /tmp/cover . && go tool cover -html /tmp/cover

To install go cover, run the following command:

go get golang.org/x/tools/cmd/cover

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFieldsRequired is returned when a point does not any fields.
	ErrFieldsRequired = errors.New("fields required")

	// ErrFieldTypeConflict is returned when a new field already exists with a different type.
	ErrFieldTypeConflict = errors.New("field type conflict")
)

Functions

func ErrDatabaseNotFound

func ErrDatabaseNotFound(name string) error

func Errorf

func Errorf(format string, a ...interface{}) (err error)

Types

This section is empty.

Directories

Path Synopsis
internal
Package internal is a generated protocol buffer package.
Package internal is a generated protocol buffer package.
cmd
db
internal
Package internal is a generated protocol buffer package.
Package internal is a generated protocol buffer package.
internal
Package internal is a generated protocol buffer package.
Package internal is a generated protocol buffer package.
services
hh
Package hh implements a hinted handoff for writes
Package hh implements a hinted handoff for writes
Package toml implements some helper methods to deal with Duration inside configuration files
Package toml implements some helper methods to deal with Duration inside configuration files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL