utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OBJECT_OPTION_ONE_MATCH_TWO = 0x1
	OBJECT_OPTION_TWO_MATCH_ONE = 0x2
	OBJECT_OPTION_SAME          = 0x4
)

Variables

This section is empty.

Functions

func AddInt

func AddInt(x *big.Int, y int64) *big.Int

func Atoi

func Atoi(num string, value int) (int, error)

func Conditional

func Conditional(condition, trueExp, falseExp interface{}) interface{}

func Contain

func Contain(listOrMap, obj interface{}) bool

func Contains

func Contains(s []string, e string) bool

func ContainsWithoutCase

func ContainsWithoutCase(s []string, e string) bool

func Convert

func Convert(i interface{}) interface{}

func CopyInt

func CopyInt(src *big.Int) *big.Int

func InList

func InList(list []string, e string) bool

func Intersection

func Intersection(s1, s2 []string) (inter []string)

func IsFunc

func IsFunc(v interface{}) bool

func IsIn

func IsIn(dataList interface{}, data interface{}) bool

func IsNil

func IsNil(i interface{}) bool

func Must

func Must(ops ...interface{})

func NewError

func NewError(message string, err string) error

封装error类型

func Now

func Now() string

返回当前时间

func OR

func OR(one, value interface{}) interface{}

func PrettyPrintJson

func PrettyPrintJson(b []byte) string

func SubSlice

func SubSlice(s1 []string, s2 []string) bool

Types

type BaseList

type BaseList struct {
	L []interface{}
}

func NewBaseList

func NewBaseList(ls ...interface{}) BaseList

func (*BaseList) Add

func (bl *BaseList) Add(s ...interface{}) bool

func (BaseList) Copy

func (bl BaseList) Copy() CopyAble

func (*BaseList) Delete

func (bl *BaseList) Delete(index int) (bool, error)

func (*BaseList) Insert

func (bl *BaseList) Insert(index int, s interface{}) (bool, error)

func (*BaseList) Iterator

func (bl *BaseList) Iterator() Iterator

func (*BaseList) Len

func (bl *BaseList) Len() int

func (*BaseList) List

func (bl *BaseList) List() []interface{}

type Column

type Column struct {
	Name     string
	Table    *Table
	DataList DistinctList
}

func NewColumn

func NewColumn(name string, t *Table, data []interface{}) *Column

return NewColumn(name, t, data)

func (*Column) List

func (cl *Column) List() DistinctList

type CopyAble

type CopyAble interface {
	Copy() CopyAble
}

type DistinctList

type DistinctList []interface{}

func (DistinctList) Distinct

func (dl DistinctList) Distinct() DistinctList

type Iterator

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

func (*Iterator) Add

func (i *Iterator) Add(v interface{})

func (*Iterator) Delete

func (i *Iterator) Delete() interface{}

func (*Iterator) HasNext

func (i *Iterator) HasNext() bool

func (*Iterator) Next

func (i *Iterator) Next() (index int, v interface{})

type List

type List interface {
	Len() int
	List() []interface{}
	Add(s ...interface{}) bool
	Delete(index int) (bool, error)
	Insert(index int, s interface{}) (bool, error)
	Copy() BaseList
	Iterator() Iterator
}

type PairFormatter

type PairFormatter string

type Row

type Row struct {
	Table    *Table
	DataList DistinctList
}

func NewRow

func NewRow(t *Table, cells []interface{}) *Row

func (Row) Cell

func (r Row) Cell(name string) interface{}

func (Row) Cells

func (r Row) Cells(fields ...string) []interface{}

func (Row) List

func (r Row) List() DistinctList

func (Row) Map

func (r Row) Map() map[string]interface{}

type Table

type Table struct {
	Columns      []string
	Rows         [][]interface{}
	DefaultValue interface{}
}

func (*Table) AddColumn

func (t *Table) AddColumn(name string)

func (*Table) Column

func (t *Table) Column(name string) *Column

func (*Table) ColumnIndex

func (t *Table) ColumnIndex(name string) (index int)

func (*Table) GroupBy

func (t *Table) GroupBy(fields ...string) []*Table

func (*Table) Iterator

func (t *Table) Iterator() *TableIterator

func (*Table) PrettyPrint

func (t *Table) PrettyPrint()

func (*Table) Push

func (t *Table) Push(data map[string]interface{})

func (*Table) Row

func (t *Table) Row(index int) *Row

type TableIterator

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

func (*TableIterator) HasNext

func (it *TableIterator) HasNext() bool

func (*TableIterator) Next

func (it *TableIterator) Next() (index int, data map[string]interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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