Versions in this module Expand all Collapse all v0 v0.0.2 Jun 30, 2022 Changes in this version type TBLN + func (t *TBLN) String() string v0.0.1 Jun 21, 2019 Changes in this version + const ED25519 + const SHA256 + const SHA512 + var ESCAPE = regexp.MustCompile(`(\|+)`) + var UNESCAPE = regexp.MustCompile(`\|(\|+)`) + func ColumnPrimaryKey(pKeys []Pkey, row []string) []string + func DiffAll(writer io.Writer, t1, t2 Reader, diffMode DiffMode) error + func JoinRow(row []string) string + func SplitRow(str string) []string + func WriteAll(writer io.Writer, tbln *TBLN) error + type Compare struct + PK []Pkey + func NewCompare(t1, t2 Reader) (*Compare, error) + func (cmp *Compare) ReadDiffRow() (*DiffRow, error) + type Definition struct + Comments []string + Extras map[string]Extra + Hashes map[string][]byte + Signs Signatures + func MergeDefinition(t1d, t2d *Definition) (*Definition, error) + func NewDefinition() *Definition + func (d *Definition) AllTargetHash(target bool) + func (d *Definition) ColumnNum() int + func (d *Definition) ExtraValue(key string) interface{} + func (d *Definition) GetDefinition() *Definition + func (d *Definition) GetPKeyPos() ([]int, error) + func (d *Definition) Names() []string + func (d *Definition) PrimaryKey() []string + func (d *Definition) SerializeHash() []byte + func (d *Definition) SetExtra(keyName string, value string) + func (d *Definition) SetHashes(hashes []string) error + func (d *Definition) SetNames(names []string) error + func (d *Definition) SetSignatures(sign []string) error + func (d *Definition) SetTableName(name string) + func (d *Definition) SetTimeStamp() error + func (d *Definition) SetTypes(types []string) error + func (d *Definition) TableName() string + func (d *Definition) ToTargetHash(key string, target bool) + func (d *Definition) Types() []string + type DiffMode int + const AllDiff + const OnlyAdd + const OnlyDiff + func (m DiffMode) String() string + type DiffRow struct + Les int + Other []string + Self []string + func (d *DiffRow) Diff(diffMode DiffMode) string + func (d *DiffRow) ExceptRow() []string + func (d *DiffRow) MergeRow(mode MergeMode) []string + type Extra struct + func NewExtra(value interface{}, hashTarget bool) Extra + func (e *Extra) Value() interface{} + type FileReader struct + func NewReader(r io.Reader) *FileReader + func (tr *FileReader) ReadRow() ([]string, error) + type MergeMode int + const MergeDelete + const MergeIgnore + const MergeUpdate + type OwnReader struct + func NewOwnReader(t *TBLN) *OwnReader + func (rr *OwnReader) ReadRow() ([]string, error) + type Pkey struct + Name string + Pos int + Typ string + type Reader interface + GetDefinition func() *Definition + ReadRow func() ([]string, error) + type Signature struct + type Signatures map[string]Signature + type TBLN struct + RowNum int + Rows [][]string + func ExceptAll(t1, t2 Reader) (*TBLN, error) + func MergeAll(t1, t2 Reader, mode MergeMode) (*TBLN, error) + func NewTBLN() *TBLN + func ReadAll(r io.Reader) (*TBLN, error) + func (t *TBLN) AddRows(row []string) error + func (t *TBLN) Sign(name string, pkey []byte) (map[string]Signature, error) + func (t *TBLN) SumHash(hashType string) error + func (t *TBLN) Verify() bool + func (t *TBLN) VerifySignature(name string, pubkey []byte) bool + type Writer struct + Writer io.Writer + func NewWriter(w io.Writer) *Writer + func (w *Writer) WriteDefinition(d *Definition) error + func (w *Writer) WriteRow(row []string) error