olap

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: MIT Imports: 2 Imported by: 3

README

Aclivo OLAP

Build status GoReport GoDoc codebeat badge last commit


Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCellNotFound           = errors.New("cell not found")
	ErrCubeNotFound           = errors.New("cube not found")
	ErrElementNotFound        = errors.New("element not found")
	ErrComponentNotFound      = errors.New("component not found")
	ErrDimensionNotFound      = errors.New("dimension not found")
	ErrCubeAlreadyExists      = errors.New("cube already exists")
	ErrElementAlreadyExists   = errors.New("element already exists")
	ErrComponentAlreadyExists = errors.New("component already exists")
	ErrDimensionAlreadyExists = errors.New("dimension already exists")
)

Functions

This section is empty.

Types

type Cell

type Cell struct {
	Cube     string
	Elements []string
	Value    float64
}

type Cube

type Cube struct {
	Name       string
	Dimensions []string
}

type Dimension

type Dimension struct {
	Name string
}

type Element

type Element struct {
	Name      string
	Dimension string
	Weight    float64
}

type Rows

type Rows interface {
	Columns() []string
	Next() bool
	Scan(...interface{})
}

type Server

type Server interface {
	Storage // Server extends the storage

	// Get & Put Cell
	Get(ctx context.Context, cube string, elements ...string) float64
	Put(ctx context.Context, value float64, cube string, elements ...string)

	Query(ctx context.Context, view View) (Rows, error)
	NewView(ctx context.Context, cube string, elements ...[]string) (View, error)
}

type Storage

type Storage interface {
	// Cube methods
	AddCube(ctx context.Context, cube Cube) error
	GetCube(ctx context.Context, name string) (Cube, error)

	// Dimension methods
	AddDimension(ctx context.Context, dim Dimension) error
	GetDimension(ctx context.Context, name string) (Dimension, error)

	// Element methods
	AddElement(ctx context.Context, el Element) error
	GetElement(ctx context.Context, dim, name string) (Element, error)

	// Component methods
	AddComponent(ctx context.Context, tot, el Element) error
	GetComponent(ctx context.Context, dim, name string) (Element, error)
	Children(ctx context.Context, dim, name string) ([]Element, error)

	// Cell methods
	AddCell(ctx context.Context, cell Cell) error
	GetCell(ctx context.Context, cube string, elements ...string) (Cell, error)
}

type View

type View struct {
	Cube   string
	Slices map[string][]string
}

Jump to

Keyboard shortcuts

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