Skip to content

Commit

Permalink
Rename package to veldt.
Browse files Browse the repository at this point in the history
  • Loading branch information
kbirk committed Jan 27, 2017
1 parent 7c0f042 commit 8219dd8
Show file tree
Hide file tree
Showing 85 changed files with 278 additions and 257 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
root = true

# Unix-style newlines with a newline ending every file
[*]
[*.go]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
TODO.md
.glide
.idea
TODO.md
vendor
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: go
notifications:
email: false
go:
- 1.6
- 1.7
before_script:
- make install
script:
- make build
- make test
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2016 Uncharted Software Inc.
Copyright © 2015-2017 Uncharted Software Inc.

Property of Uncharted™, formerly Oculus Info Inc.
http://uncharted.software/
Expand Down
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Prism
# veldt

>Harness the full spectrum of your data.
> Scalable on-demand tile-based analytics
[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](http://godoc.org/github.com/unchartedsoftware/veldt)
[![Build Status](https://travis-ci.org/unchartedsoftware/veldt.svg?branch=master)](https://travis-ci.org/unchartedsoftware/veldt)
[![Go Report Card](https://goreportcard.com/badge/github.com/unchartedsoftware/veldt)](https://goreportcard.com/report/github.com/unchartedsoftware/veldt)

## Dependencies

Expand All @@ -13,7 +17,7 @@ Requires the [Go](https://golang.org/) programming language binaries with the `G
If your project does not use the vendoring tool [Glide](https://glide.sh) to manage dependencies, you can install this package like you would any other:

```bash
go get github.com/unchartedsoftware/prism
go get github.com/unchartedsoftware/veldt
```

While this is the simplest way to install the package, due to how `go get` resolves transitive dependencies it may result in version incompatibilities.
Expand All @@ -23,14 +27,14 @@ While this is the simplest way to install the package, due to how `go get` resol
This is the recommended way to install the package and ensures all transitive dependencies are resolved to their compatible versions.

```bash
glide get github.com/unchartedsoftware/prism
glide get github.com/unchartedsoftware/veldt
```

NOTE: Requires [Glide](https://glide.sh) along with [Go](https://golang.org/) version 1.6+.

## Usage

The package provides facilities to implement and connect custom tiling analytics to persistent in-memory storage services.
The package provides facilities to implement and connect live tile-based analytics to persistent in-memory storage services.

## Example

Expand All @@ -40,14 +44,14 @@ This minimalistic application shows how to register tile and meta data generator
package main

import (
"github.com/unchartedsoftware/prism"
"github.com/unchartedsoftware/prism/generation/elastic"
"github.com/unchartedsoftware/prism/store/redis"
"github.com/unchartedsoftware/veldt"
"github.com/unchartedsoftware/veldt/generation/elastic"
"github.com/unchartedsoftware/veldt/store/redis"
)

func main() {
// Create pipeline
pipeline := prism.NewPipeline()
pipeline := veldt.NewPipeline()

// Add boolean expression types
pipeline.Binary(elastic.NewBinaryExpression)
Expand All @@ -67,17 +71,17 @@ func main() {
// Set the tile requests queue length
pipeline.SetQueueLength(1024)

// Add a store to the pipeline
// Add a redis store to the pipeline
pipeline.Store(redis.NewStore("localhost", "6379", -1))

// register the pipeline
prism.Register("elastic", pipeline)
veldt.Register("elastic", pipeline)

// Create tile JSON request
req :=
`
{
"uri": "twitter_index0",
"uri": "sample_index0",
"coord": {
"z": 4,
"x": 12,
Expand Down Expand Up @@ -114,12 +118,12 @@ func main() {

// Generate a tile, this call will block until the tile is ready in the
// store.
err := prism.GenerateTile("elastic", req)
err := veldt.GenerateTile("elastic", req)
if err != nil {
panic(err)
}
// Retrieve the tile form the store.
tile, err := tile.GetTileFromStore("elastic", t)
tile, err := veldt.GetTileFromStore("elastic", t)
if err != nil {
panic(err)
}
Expand All @@ -133,12 +137,12 @@ Clone the repository:
```bash
mkdir -p $GOPATH/src/github.com/unchartedsoftware
cd $GOPATH/src/github.com/unchartedsoftware
git clone git@github.com:unchartedsoftware/prism.git
git clone git@github.com:unchartedsoftware/veldt.git
```

Install dependencies:

```bash
cd prism
cd veldt
make install
```
2 changes: 1 addition & 1 deletion binning/geo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/unchartedsoftware/prism/binning"
"github.com/unchartedsoftware/veldt/binning"
)

var _ = Describe("geo", func() {
Expand Down
2 changes: 1 addition & 1 deletion binning/pixel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/unchartedsoftware/prism/binning"
"github.com/unchartedsoftware/veldt/binning"
)

var _ = Describe("pixel", func() {
Expand Down
2 changes: 1 addition & 1 deletion binning/xy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/unchartedsoftware/prism/binning"
"github.com/unchartedsoftware/veldt/binning"
)

var _ = Describe("xy", func() {
Expand Down
2 changes: 1 addition & 1 deletion boolean.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package prism
package veldt

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion expression.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package prism
package veldt

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion generate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package prism
package veldt

// GenerateTile generates a tile for the provided pipeline ID and JSON request.
func GenerateTile(id string, args map[string]interface{}) error {
Expand Down
4 changes: 2 additions & 2 deletions generation/citus/bivariate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/jackc/pgx"

"github.com/unchartedsoftware/prism/binning"
"github.com/unchartedsoftware/prism/tile"
"github.com/unchartedsoftware/veldt/binning"
"github.com/unchartedsoftware/veldt/tile"
)

// Bivariate represents a bivariate tile generator.
Expand Down
16 changes: 8 additions & 8 deletions generation/citus/bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package citus
import (
"fmt"

"github.com/unchartedsoftware/prism"
"github.com/unchartedsoftware/veldt"
)

// BinaryExpression represents an and/or boolean query.
type BinaryExpression struct {
prism.BinaryExpression
veldt.BinaryExpression
}

// NewBinaryExpression instantiates and returns a new binary expression.
func NewBinaryExpression() (prism.Query, error) {
func NewBinaryExpression() (veldt.Query, error) {
return &BinaryExpression{}, nil
}

Expand All @@ -39,10 +39,10 @@ func (e *BinaryExpression) Get(query *Query) (string, error) {

res := ""
switch e.Op {
case prism.And:
case veldt.And:
// AND
res = fmt.Sprintf("((%s) AND (%s))", queryStringLeft, queryStringRight)
case prism.Or:
case veldt.Or:
// OR
res = fmt.Sprintf("((%s) OR (%s))", queryStringLeft, queryStringRight)
default:
Expand All @@ -53,11 +53,11 @@ func (e *BinaryExpression) Get(query *Query) (string, error) {

// UnaryExpression represents a must_not boolean query.
type UnaryExpression struct {
prism.UnaryExpression
veldt.UnaryExpression
}

// NewUnaryExpression instantiates and returns a new unary expression.
func NewUnaryExpression() (prism.Query, error) {
func NewUnaryExpression() (veldt.Query, error) {
return &UnaryExpression{}, nil
}

Expand All @@ -76,7 +76,7 @@ func (e *UnaryExpression) Get(query *Query) (string, error) {

res := ""
switch e.Op {
case prism.Not:
case veldt.Not:
// NOT
res = res + fmt.Sprintf("NOT (%s)", a)
default:
Expand Down
10 changes: 5 additions & 5 deletions generation/citus/count_tile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package citus
import (
"fmt"

"github.com/unchartedsoftware/prism"
"github.com/unchartedsoftware/prism/binning"
"github.com/unchartedsoftware/veldt"
"github.com/unchartedsoftware/veldt/binning"
)

// Count represents a citus implementation of the count tile.
Expand All @@ -14,8 +14,8 @@ type Count struct {
}

// NewCountTile instantiates and returns a new tile struct.
func NewCountTile(host, port string) prism.TileCtor {
return func() (prism.Tile, error) {
func NewCountTile(host, port string) veldt.TileCtor {
return func() (veldt.Tile, error) {
t := &Count{}
t.Host = host
t.Port = port
Expand All @@ -25,7 +25,7 @@ func NewCountTile(host, port string) prism.TileCtor {

// Create generates a tile from the provided URI, tile coordinate and query
// parameters.
func (t *Count) Create(uri string, coord *binning.TileCoord, query prism.Query) ([]byte, error) {
func (t *Count) Create(uri string, coord *binning.TileCoord, query veldt.Query) ([]byte, error) {
// Initialize the tile processing.
client, citusQuery, err := t.InitializeTile(uri, query)

Expand Down
8 changes: 4 additions & 4 deletions generation/citus/default_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/jackc/pgx"

"github.com/unchartedsoftware/prism"
"github.com/unchartedsoftware/prism/binning"
"github.com/unchartedsoftware/veldt"
"github.com/unchartedsoftware/veldt/binning"
)

// PropertyMeta represents the meta data for a single property.
Expand Down Expand Up @@ -123,8 +123,8 @@ type DefaultMeta struct {
}

// NewDefaultMeta instantiates and returns a pointer to a new generator.
func NewDefaultMeta(host string, port string) prism.MetaCtor {
return func() (prism.Meta, error) {
func NewDefaultMeta(host string, port string) veldt.MetaCtor {
return func() (veldt.Meta, error) {
return &DefaultMeta{
Host: host,
Port: port,
Expand Down
6 changes: 3 additions & 3 deletions generation/citus/equals.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package citus
import (
"fmt"

"github.com/unchartedsoftware/prism"
"github.com/unchartedsoftware/prism/query"
"github.com/unchartedsoftware/veldt"
"github.com/unchartedsoftware/veldt/query"
)

// Equals represents an = query.
Expand All @@ -13,7 +13,7 @@ type Equals struct {
}

// NewEquals instantiates and returns a new query struct.
func NewEquals() (prism.Query, error) {
func NewEquals() (veldt.Query, error) {
return &Equals{}, nil
}

Expand Down
6 changes: 3 additions & 3 deletions generation/citus/exists.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package citus
import (
"fmt"

"github.com/unchartedsoftware/prism"
"github.com/unchartedsoftware/prism/query"
"github.com/unchartedsoftware/veldt"
"github.com/unchartedsoftware/veldt/query"
)

// Exists checks for the existence of the field (not null).
Expand All @@ -13,7 +13,7 @@ type Exists struct {
}

// NewExists instantiates and returns a new query struct.
func NewExists() (prism.Query, error) {
func NewExists() (veldt.Query, error) {
return &Exists{}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion generation/citus/frequency.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/jackc/pgx"

"github.com/unchartedsoftware/prism/tile"
"github.com/unchartedsoftware/veldt/tile"
)

// Frequency represents a tiling generator that produces heatmaps.
Expand Down
10 changes: 5 additions & 5 deletions generation/citus/frequency_tile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package citus
import (
"encoding/json"

"github.com/unchartedsoftware/prism"
"github.com/unchartedsoftware/prism/binning"
"github.com/unchartedsoftware/veldt"
"github.com/unchartedsoftware/veldt/binning"
)

// FrequencyTile represents a citus implementation of the frequency tile.
Expand All @@ -15,8 +15,8 @@ type FrequencyTile struct {
}

// NewFrequencyTile instantiates and returns a new tile struct.
func NewFrequencyTile(host, port string) prism.TileCtor {
return func() (prism.Tile, error) {
func NewFrequencyTile(host, port string) veldt.TileCtor {
return func() (veldt.Tile, error) {
t := &FrequencyTile{}
t.Host = host
t.Port = port
Expand All @@ -35,7 +35,7 @@ func (t *FrequencyTile) Parse(params map[string]interface{}) error {

// Create generates a tile from the provided URI, tile coordinate and query
// parameters.
func (t *FrequencyTile) Create(uri string, coord *binning.TileCoord, query prism.Query) ([]byte, error) {
func (t *FrequencyTile) Create(uri string, coord *binning.TileCoord, query veldt.Query) ([]byte, error) {
// Initialize the tile processing.
client, citusQuery, err := t.InitializeTile(uri, query)

Expand Down
Loading

0 comments on commit 8219dd8

Please sign in to comment.