tablestream

package
v0.0.0-...-a2182bf Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VARCHAR  fieldType = "varchar"
	INTEGER  fieldType = "integer"
	DATETIME fieldType = "datetime"
)

Variables

This section is empty.

Functions

func TableWrite

func TableWrite(v *View, file io.Writer)

Types

type AggregatedValue

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

type AggregatedViewData

type AggregatedViewData struct {
	SimpleViewData
}

func (*AggregatedViewData) AVG

func (v *AggregatedViewData) AVG(newData interface{}, groupByNameArray []string) (interface{}, error)

func (*AggregatedViewData) COUNT

func (v *AggregatedViewData) COUNT(newData interface{}, groupByNameArray []string) (interface{}, error)

func (*AggregatedViewData) CallUpdateValue

func (v *AggregatedViewData) CallUpdateValue(value interface{}) (interface{}, error)

func (*AggregatedViewData) Fetch

func (v *AggregatedViewData) Fetch(key string) interface{}

func (*AggregatedViewData) FetchAll

func (v *AggregatedViewData) FetchAll() map[string]interface{}

func (*AggregatedViewData) KeyArray

func (v *AggregatedViewData) KeyArray() []kv

func (*AggregatedViewData) Length

func (v *AggregatedViewData) Length() int

func (*AggregatedViewData) MAX

func (v *AggregatedViewData) MAX(newData interface{}, groupByNameArray []string) (interface{}, error)

func (*AggregatedViewData) MIN

func (v *AggregatedViewData) MIN(newData interface{}, groupByNameArray []string) (interface{}, error)

func (*AggregatedViewData) RATE

func (v *AggregatedViewData) RATE(newData interface{}, groupByNameArray []string) (interface{}, error)

func (*AggregatedViewData) SESSION

func (v *AggregatedViewData) SESSION(newData interface{}, groupByNameArray []string) (interface{}, error)

func (*AggregatedViewData) SUM

func (v *AggregatedViewData) SUM(newData interface{}, groupByNameArray []string) (interface{}, error)

func (*AggregatedViewData) SetAggregatedValue

func (v *AggregatedViewData) SetAggregatedValue(newData interface{}, groupByNameArray []string) (interface{}, error)

func (*AggregatedViewData) URLIFY

func (v *AggregatedViewData) URLIFY(newData interface{}, groupByName []string) (interface{}, error)

func (*AggregatedViewData) UpdateModifier

func (v *AggregatedViewData) UpdateModifier(mod string) error

func (*AggregatedViewData) Value

func (v *AggregatedViewData) Value() interface{}

type AnalyticFunc

type AnalyticFunc interface {
	Value() int
}

type AndCondition

type AndCondition struct {
	Conditioner
	// contains filtered or unexported fields
}

func (*AndCondition) Evaluate

func (c *AndCondition) Evaluate(row map[string]string) bool

type Conditioner

type Conditioner interface {
	Evaluate(map[string]string) bool
}

type Field

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

type Operator

type Operator string
const (
	Equal          Operator = "="
	NotEqual       Operator = "!="
	Greater        Operator = ">"
	GreaterOrEqual Operator = ">="
	Less           Operator = "<"
	LessOrEqual    Operator = "<="
	Like           Operator = "like"
)

type OrCondition

type OrCondition struct {
	Conditioner
	// contains filtered or unexported fields
}

func (*OrCondition) Evaluate

func (c *OrCondition) Evaluate(row map[string]string) bool

type OrderBy

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

type ParentCondition

type ParentCondition struct {
	Conditioner
	// contains filtered or unexported fields
}

func (*ParentCondition) Evaluate

func (c *ParentCondition) Evaluate(row map[string]string) bool

type SimpleCondition

type SimpleCondition struct {
	Conditioner
	// contains filtered or unexported fields
}

func (*SimpleCondition) Evaluate

func (c *SimpleCondition) Evaluate(row map[string]string) bool

type SimpleViewData

type SimpleViewData struct {
	ViewData
	// contains filtered or unexported fields
}

func (*SimpleViewData) CallUpdateValue

func (v *SimpleViewData) CallUpdateValue(value interface{}) (interface{}, error)

func (*SimpleViewData) Fetch

func (v *SimpleViewData) Fetch(key string) interface{}

func (*SimpleViewData) Field

func (v *SimpleViewData) Field() *Field

func (*SimpleViewData) Length

func (v *SimpleViewData) Length() int

func (*SimpleViewData) Modifier

func (v *SimpleViewData) Modifier() string

func (*SimpleViewData) Name

func (v *SimpleViewData) Name() string

func (*SimpleViewData) SelectedField

func (v *SimpleViewData) SelectedField() bool

func (*SimpleViewData) SetName

func (v *SimpleViewData) SetName(name string)

func (*SimpleViewData) SetParams

func (v *SimpleViewData) SetParams(params []interface{})

func (*SimpleViewData) SetValue

func (v *SimpleViewData) SetValue(value interface{}) (interface{}, error)

func (*SimpleViewData) UpdateModifier

func (v *SimpleViewData) UpdateModifier(mod string) error

func (*SimpleViewData) Value

func (v *SimpleViewData) Value() interface{}

func (*SimpleViewData) VarType

func (v *SimpleViewData) VarType() fieldType

type Stream

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

func (*Stream) AddTable

func (s *Stream) AddTable(t Table)

func (*Stream) AddView

func (s *Stream) AddView(v *View)

func (*Stream) GetView

func (s *Stream) GetView(name string) (*View, error)

func (*Stream) GetViews

func (s *Stream) GetViews() []*View

func (*Stream) Query

func (s *Stream) Query(query string) error

func (*Stream) Table

func (s *Stream) Table(name string) (Table, error)

func (*Stream) Tables

func (s *Stream) Tables() []Table

type Table

type Table interface {
	AddRow(interface{}) error
	SetRowSeparator(string)
	RowSeparator() string
	AddField(*Field) error
	Fields() []*Field
	Field(name string) *Field
	Name() string
	SetName(string)
	SetTypeInstance(string, chan map[string]string)
	TypeInstance(string) chan map[string]string
	Lock()
	Unlock()
}

type TableRegex

type TableRegex struct {
	TableSimple
	// contains filtered or unexported fields
}

func CreateTableRegex

func CreateTableRegex(name string) *TableRegex

func (*TableRegex) AddRow

func (t *TableRegex) AddRow(data interface{}) error

type TableSimple

type TableSimple struct {
	Table
	// contains filtered or unexported fields
}

func CreateTable

func CreateTable(name string) *TableSimple

func (*TableSimple) AddField

func (t *TableSimple) AddField(f *Field) error

func (*TableSimple) AddRow

func (t *TableSimple) AddRow(data interface{}) error

AddRow TODO: Implement some simple data push or keeper

func (*TableSimple) Field

func (t *TableSimple) Field(name string) *Field

func (*TableSimple) Fields

func (t *TableSimple) Fields() []*Field

func (*TableSimple) Lock

func (t *TableSimple) Lock()

func (*TableSimple) Name

func (t *TableSimple) Name() string

func (*TableSimple) RowSeparator

func (t *TableSimple) RowSeparator() string

func (*TableSimple) SetName

func (t *TableSimple) SetName(name string)

func (*TableSimple) SetRowSeparator

func (t *TableSimple) SetRowSeparator(sep string)

func (*TableSimple) SetTypeInstance

func (t *TableSimple) SetTypeInstance(key string, channel chan map[string]string)

func (*TableSimple) TypeInstance

func (t *TableSimple) TypeInstance(key string) chan map[string]string

func (*TableSimple) Unlock

func (t *TableSimple) Unlock()

type View

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

func CreateView

func CreateView(name string) *View

func (*View) AddError

func (v *View) AddError(err error)

func (*View) AddOrderBy

func (v *View) AddOrderBy(orderByField ViewData, direction string)

func (*View) AddTable

func (v *View) AddTable(t Table)

func (*View) AddViewData

func (v *View) AddViewData(vd ViewData)

func (*View) DatetimeViewData

func (v *View) DatetimeViewData(idx int, keys []string) []time.Time

func (*View) FetchAllRows

func (v *View) FetchAllRows() [][]string

func (*View) IntViewData

func (v *View) IntViewData(idx int, keys []string) []int

func (*View) Lock

func (v *View) Lock() *sync.Mutex

func (*View) Name

func (v *View) Name() string

func (*View) OrderedKeys

func (v *View) OrderedKeys() []string

func (*View) PrintView

func (v *View) PrintView()

func (*View) SetCondition

func (v *View) SetCondition(cond Conditioner)

func (*View) SetGroupBy

func (v *View) SetGroupBy(groupByFields []ViewData)

func (*View) SetLimit

func (v *View) SetLimit(limit int)

func (*View) StringViewData

func (v *View) StringViewData(idx int, keys []string) []string

func (*View) UpdateView

func (v *View) UpdateView()

func (*View) ViewData

func (v *View) ViewData(name string) ViewData

func (*View) ViewDataByFieldName

func (v *View) ViewDataByFieldName(name string) []ViewData

func (*View) ViewDataByName

func (v *View) ViewDataByName(name string) []ViewData

func (*View) ViewDatas

func (v *View) ViewDatas() []ViewData

type ViewData

type ViewData interface {
	UpdateModifier(mod string) error
	Modifier() string
	Value() interface{}
	SetValue(value interface{}) (interface{}, error)
	Name() string
	SetName(string)
	Field() *Field
	CallUpdateValue(value interface{}) (interface{}, error)
	Length() int
	Fetch(key string) interface{}
	VarType() fieldType
	KeyArray() []kv
	SelectedField() bool
	SetParams(params []interface{})
}

Jump to

Keyboard shortcuts

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