Documentation ¶
Overview ¶
(c) Kamiar Bahri
(c) Kamiar Bahri
(c) Kamiar Bahri
(c) Kamiar Bahri
(c) Kamiar Bahri
(c) Kamiar Bahri
(c) Kamiar Bahri
(c) Kamiar Bahri
(c) Kamiar Bahri
Index ¶
- func Decrypt(data []byte, passphrase string) ([]byte, error)
- func DecryptFile(p string, pwdPhrase string) error
- func Encrypt(plainData []byte, passphrase string) ([]byte, error)
- func EncryptFile(p string, pwdPhrase string) error
- type Collection
- type Cols
- func (c *Cols) Add(name string) *Column
- func (c *Cols) Clear()
- func (c *Cols) ColDataCount(colName string) int
- func (c *Cols) ColDataNoNULL(colName string) int
- func (c *Cols) Count() int
- func (c *Cols) Exists(colName string) bool
- func (c *Cols) Get() []Column
- func (c *Cols) GetData(colName string) []interface{}
- func (c *Cols) GetDataDistinct(colName string) ([]interface{}, []interface{})
- func (c *Cols) GetOccurrence(colName string, value interface{}, data []interface{}) int
- func (c *Cols) GetOccurrenceMatrix(colName string, tbl *Table)
- func (c *Cols) InsertAt(pos int, col Column) error
- func (c *Cols) ResetColTypes()
- func (c *Cols) SetColumns(colArry []Column)
- type Column
- type Dataset
- func (d *Dataset) Add(tbl Table) error
- func (d *Dataset) Deserialize(data []byte) ([]Table, error)
- func (d *Dataset) DeserializeFromFile(fPath string) ([]Table, error)
- func (d *Dataset) Remove(i int) error
- func (d *Dataset) RemoveByName(tblName string) error
- func (d *Dataset) Serialize() ([]byte, error)
- func (d *Dataset) SerializeToFile(fPath string) error
- func (d *Dataset) TableExists(tbl *Table) bool
- type Element
- type IColumn
- type IDataset
- type IRows
- type ITable
- type OccurrenceMatrix
- type Row
- type RowHash
- type Rows
- func (r *Rows) Add(row Row)
- func (r *Rows) AddSharedData(sharedDataItem SharedDataItem) error
- func (r *Rows) Clear()
- func (r *Rows) Count() int
- func (r *Rows) GetColumns() []Column
- func (r *Rows) GetJSON() string
- func (r *Rows) GetLastRow() Row
- func (r *Rows) GetLastRowIndex() int
- func (r *Rows) GetRow(indx int) Row
- func (r *Rows) GetRowIndex(row Row) int
- func (r *Rows) GetRowJSON(inx int) string
- func (r *Rows) GetRows() []Row
- func (r *Rows) GetRowsByTagName(tagName string) []Row
- func (r *Rows) GetSharedData(tagName string) SharedDataItem
- func (r *Rows) GetTag(i int) Tag
- func (r *Rows) InsertRecords(input [][]string, verbose bool)
- func (r *Rows) InsertSingleRecord(input []string)
- func (r *Rows) New() Row
- func (r *Rows) SetColumns(cols []Column)
- func (r *Rows) SetTag(i int, tag Tag)
- func (r *Rows) UpdateRow(row Row) error
- type SharedDataItem
- type SortOrder
- type Table
- func (t *Table) Create(name string) (*Table, error)
- func (t *Table) Deserialize(b []byte) (*Table, error)
- func (t *Table) DeserializeFromFile(fPath string) (*Table, error)
- func (t *Table) GetJSON(tbl *Table) string
- func (t *Table) Serialize(tbl *Table) ([]byte, error)
- func (t *Table) SerializeToFile(tbl *Table, fPath string) error
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptFile ¶
DecryptFile decryptes a file using the AES algorythm.
func EncryptFile ¶
Encrypt encryptes a file using the AES algorythm.
Types ¶
type Collection ¶
Collection defines the List and Table interfaces.
func NewCollection ¶
func NewCollection() *Collection
NewCollection makes a new instance of collections. It includes List, and Table (Rows/Columns)
type Cols ¶
Columns is the IColumn interface handler.
func (*Cols) ColDataCount ¶
func (*Cols) ColDataNoNULL ¶
func (*Cols) GetDataDistinct ¶
func (*Cols) GetOccurrence ¶
func (*Cols) GetOccurrenceMatrix ¶
func (*Cols) ResetColTypes ¶
func (c *Cols) ResetColTypes()
func (*Cols) SetColumns ¶
type Dataset ¶
type Dataset struct {
Tables []Table
}
Dataset is the handler for the IDatasetHndlr interface.
func (*Dataset) DeserializeFromFile ¶
func (*Dataset) RemoveByName ¶
func (*Dataset) SerializeToFile ¶
func (*Dataset) TableExists ¶
type Element ¶
type Element struct { Key string `json:"key"` Value interface{} `json:"value"` }
Element is a key/value structure that holds an item in the list.
type IColumn ¶
type IColumn interface { Add(name string) *Column Get() []Column SetColumns(colArry []Column) // Clear drops all columns Clear() Exists(colName string) bool Count() int InsertAt(pos int, col Column) error // GetOccurrence gets a count of number-of-times a values is // repeated in a column's data. GetOccurrence(colName string, value interface{}, data []interface{}) int // GetOccurrenceMatrix reports the number of ccurrence // for each value in a column. //GetOccurrenceMatrix(colName string) []OccurrenceMatrix GetOccurrenceMatrix(colName string, tbl *Table) // ResetColTypes re-examins the values in columns to // esure that the correct type is set; i.e. when loadng // CSV all columns' type may be set to string (e.g // "433" vs 433). ResetColTypes() // GetData retrieves all values of a column. GetData(colName string) []interface{} ColDataCount(colName string) int ColDataNoNULL(colName string) int // GetDataDistinct gets all distinct values of a column. GetDataDistinct(colName string) ([]interface{}, []interface{}) // contains filtered or unexported methods }
IColumn is the column interface.
type IDataset ¶
type IDataset interface { Add(tbl Table) error Remove(i int) error RemoveByName(tblName string) error Serialize() ([]byte, error) SerializeToFile(fPath string) error Deserialize(data []byte) ([]Table, error) DeserializeFromFile(fPath string) ([]Table, error) }
IDataset is the Dataset interface (describes the Dataset interface).
type IRows ¶
type IRows interface { // New creates an empty row and returns its map. New() Row // Add adds a row the Rows array. Add(row Row) SetColumns(cols []Column) // GetColumns returs a list of []Column, The first element is a built-in // column called _rowid; it holds the index position of the row at the // time it was created. GetColumns() []Column Count() int // GetJSON returns a json representation of the entire table. GetJSON() string GetRows() []Row GetRow(rowIndex int) Row GetLastRow() Row GetRowIndex(row Row) int GetLastRowIndex() int UpdateRow(irow Row) error GetRowJSON(i int) string GetRowsByTagName(tagName string) []Row SetTag(rowIndex int, tag Tag) GetTag(rowIndex int) Tag // InsertRecords creates new rows from a two demintional array of string. // Example of input is a result-set from reading CSV file. InsertRecords(input [][]string, verbose bool) // InsertSingleRecord creates a new row from an array of string. InsertSingleRecord(input []string) // Clear drops all rows. Clear() }
rowInterface defines the methods for Row operations.
type ITable ¶
type ITable interface { Create(name string) (*Table, error) // GetJSON gets a json string of the entire table. GetJSON(tbl *Table) string // Serialize create a []byte representation of the entire // table, which can written to disk. Serialize(tbl *Table) ([]byte, error) // Deserialize transforms []byte to *Table. Deserialize(data []byte) (*Table, error) SerializeToFile(tbl *Table, fPath string) error DeserializeFromFile(fPath string) (*Table, error) }
ITable is the table interface.
type OccurrenceMatrix ¶
type OccurrenceMatrix struct { Value interface{} `json:"value"` Occurred int `json:"occurred"` }
type Rows ¶
Rows defines fields that comprise one Row; and it acts as a bridge between the caller and its interface.
func (*Rows) AddSharedData ¶
func (r *Rows) AddSharedData(sharedDataItem SharedDataItem) error
func (*Rows) GetColumns ¶
func (*Rows) GetLastRow ¶
func (*Rows) GetLastRowIndex ¶
func (*Rows) GetRowIndex ¶
func (*Rows) GetRowJSON ¶
func (*Rows) GetRowsByTagName ¶
func (*Rows) GetSharedData ¶
func (r *Rows) GetSharedData(tagName string) SharedDataItem
func (*Rows) InsertRecords ¶
InsertRecords reads a two-dim. string arrary into the Table. Note: there is perfomance hit when verbose is on
func (*Rows) InsertSingleRecord ¶
func (*Rows) SetColumns ¶
type SharedDataItem ¶
type SharedDataItem struct {}
SharedDataItem is a data is linked to rows by tag name.