entropy

package
v0.0.0-...-7785fb1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2014 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTableDoesNotExist = errors.New("table does not exist")
	ErrNoPreviousVersion = errors.New("no previous version found")
)

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func EnsureDBVersion

func EnsureDBVersion(db *sql.DB) (int64, error)

func Migrate

func Migrate(db *sql.DB) error

Types

type Aggregation

type Aggregation interface {
	AttributeName() string
	Parent() string
	Bucket(string) string
}

type Answer

type Answer struct {
}

type ChangeEvent

type ChangeEvent interface {
	Id() string
}

type Constraint

type Constraint interface {
	AttributeName() string
}

type DataType

type DataType uint
const (
	DateTime DataType = iota
)

type DateAggregation

type DateAggregation struct{}

func (*DateAggregation) AttributeName

func (d *DateAggregation) AttributeName() string

func (*DateAggregation) Bucket

func (d *DateAggregation) Bucket(value string) string

func (*DateAggregation) Granularity

func (d *DateAggregation) Granularity() DateGranularity

func (*DateAggregation) Parent

func (d *DateAggregation) Parent() string

type DateGranularity

type DateGranularity uint
const (
	Yearly DateGranularity = iota
	Monthly
	Daily
)

type Iter

type Iter struct {
	// contains filtered or unexported fields
}

func Commence

func Commence(repository int64) *Iter

func NextQuestion

func NextQuestion(repository int64, cons []Constraint, aggs []Aggregation, p *Pruner) *Iter

func (*Iter) Next

func (iter *Iter) Next() Question

type MerkleNode

type MerkleNode struct {
	Name    string
	Id      string
	Version string
	Child   *MerkleNode
}

func BuildDateTimeNode

func BuildDateTimeNode(id string, version string, d time.Time) *MerkleNode

func BuildEntityNode

func BuildEntityNode(id string, version string) *MerkleNode

func BuildHierarchy

func BuildHierarchy(path string) *MerkleNode

func (*MerkleNode) DescendencyPath

func (node *MerkleNode) DescendencyPath() string

func (*MerkleNode) IsLeaf

func (node *MerkleNode) IsLeaf() bool

type MigrationRecord

type MigrationRecord struct {
	VersionId int64
	TStamp    time.Time
	IsApplied bool
}

type PartitionedEvent

type PartitionedEvent interface {
	UnpartitionedEvent
	Attributes() map[string]string
	AttributeHierarchy() *MerkleNode
}

func NewDatePartitionedEvent

func NewDatePartitionedEvent(id, version, attributeName string, d time.Time) PartitionedEvent

type Pruner

type Pruner struct {
}

func (*Pruner) Finish

func (p *Pruner) Finish()

func (*Pruner) Prune

func (p *Pruner) Prune(a Answer)

type Question

type Question interface {
	Constraints() []Constraint
	Aggregations() []Aggregation
	SliceThreshold() int
}

type RangePartitionDescriptor

type RangePartitionDescriptor struct {
	DataType DataType
}

type TombstoneEvent

type TombstoneEvent interface {
	ChangeEvent
}

type UnpartitionedEvent

type UnpartitionedEvent interface {
	UpsertEvent
	IdHierarchy() *MerkleNode
}

type UpsertEvent

type UpsertEvent interface {
	ChangeEvent
	Version() string
}

type VersionStore

type VersionStore struct {
	// contains filtered or unexported fields
}

func OpenStore

func OpenStore(path string) (*VersionStore, error)

func (*VersionStore) Accept

func (v *VersionStore) Accept(repo int64, ev ChangeEvent) error

func (*VersionStore) Digest

func (v *VersionStore) Digest(repo int64) (map[string]string, error)

func (*VersionStore) Interview

func (v *VersionStore) Interview(repository int64, cons []Constraint, aggs []Aggregation, answer []Answer) *Iter

func (*VersionStore) NewRepository

func (v *VersionStore) NewRepository(name string, parts map[string]RangePartitionDescriptor) (repo int64, err error)

func (*VersionStore) SliceThreshold

func (v *VersionStore) SliceThreshold() int

Jump to

Keyboard shortcuts

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