Documentation ¶
Overview ¶
Cardinality Data Structure for GO
Index ¶
- type Board
- func (b *Board) CheckRowExists(rowName string) bool
- func (b *Board) DropRow(rowName string)
- func (b *Board) Dump() (*pb.BoardData, error)
- func (b *Board) GetCell(rowName string, cellName string, createIfNotExists bool) *Cell
- func (b *Board) GetCellCount(rowName string) int
- func (b *Board) GetCellKeys(rowName string) (keys []string)
- func (b *Board) GetRowCount() int
- func (b *Board) GetRowKeys() []string
- func (b *Board) GetRowSnapshot(rowName string) *RowSnapshot
- func (b *Board) GetSnapshot() *BoardSnapshot
- func (b *Board) LoadData(data *pb.BoardData) error
- type BoardSnapshot
- type Cell
- type Cube
- func (c *Cube) DropBoard(boardName string)
- func (c *Cube) Dump() (*pb.CubeData, error)
- func (c *Cube) GetBoard(name string, createIfNotExists bool) *Board
- func (c *Cube) GetBoardCount() int
- func (c *Cube) GetBoardKeys() []string
- func (c *Cube) GetSnapshot() *Snapshot
- func (c *Cube) LoadData(data *pb.CubeData) error
- type Row
- type RowSnapshot
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Board ¶
type Board struct {
// contains filtered or unexported fields
}
Board is a table like data structure which consists of rows. It is of course thread safe.
func (*Board) CheckRowExists ¶
CheckRowExists return true if row exists in board.
func (*Board) GetCell ¶
GetCell returns cell that resides in given row. If row or cell not found function returns nil
func (*Board) GetCellCount ¶ added in v0.2.0
GetCellCount returns cell count of row. Read blocking operation.
func (*Board) GetCellKeys ¶ added in v0.2.0
GetCellKeys returns cell keys of row. Read blocking operation.
func (*Board) GetRowCount ¶ added in v0.2.0
GetRowCount returns roe count.
func (*Board) GetRowKeys ¶ added in v0.2.0
GetRowKeys returns row names. Read blocking operation.
func (*Board) GetRowSnapshot ¶
func (b *Board) GetRowSnapshot(rowName string) *RowSnapshot
GetRowSnapshot Returns snapshot of given row. Blocks row while getting its snapshot
func (*Board) GetSnapshot ¶
func (b *Board) GetSnapshot() *BoardSnapshot
GetSnapshot return board's snapshot. Blocks whole board while getting snapshot.
type BoardSnapshot ¶
type BoardSnapshot map[string]*RowSnapshot
A BoardSnapshot contains rows data of specific time
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell is constituent part of Cube. It holds values.
type Cube ¶
type Cube struct {
// contains filtered or unexported fields
}
Cube is a data structure consists of cells that allows thread safe parallel operations over them. A cube organizes it cells by holding them in maps called rows. Rows are also combined into a another map called board.
func NewCube ¶
func NewCube(coreGenerator cores.CoreInitiator, coreOpts interface{}) *Cube
NewCube creates new cube in the type of give CoreInitiator
func (*Cube) GetBoard ¶
GetBoard returns board at given key name. Returns nil if it not found or returns newly created one if createIfNotExists is set to true.
func (*Cube) GetBoardCount ¶ added in v0.2.0
GetBoardCount returns current board count in cube.
func (*Cube) GetBoardKeys ¶ added in v0.2.0
GetBoardKeys returns board names. Read blocking operation
func (*Cube) GetSnapshot ¶
GetSnapshot Returns snapshot of whole cube. Blocking operation.
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row is a build block of board. It holds Cells.
func (*Row) GetCellCount ¶ added in v0.2.0
GetCellCount returns cell count of row.
func (*Row) GetCellKeys ¶ added in v0.2.0
GetCellKeys returns keys of cells. Read blocking operation.
func (*Row) GetSnapshot ¶
func (r *Row) GetSnapshot() *RowSnapshot
GetSnapshot returns snapshot of row. Blocks row while getting snapshot.
type RowSnapshot ¶
RowSnapshot contains cell names and their accumulated values.
type Snapshot ¶
type Snapshot map[string]*BoardSnapshot
A Snapshot of cube is a map of board snapshots