Versions in this module Expand all Collapse all v0 v0.0.10 Nov 13, 2024 Changes in this version + type ECommState string + const ECommStateConnecting + const ECommStateFault + const ECommStateLinkLost + const ECommStateLinked + const ECommStateStopped + type ELog string + const ELogDebug + const ELogError + const ELogWarn v0.0.9 Nov 13, 2024 Changes in this version + type BaseDao struct + func NewDao[T any](db *gorm.DB) *BaseDao[T] + func (dao *BaseDao[T]) CheckExist(id uint64) bool + func (dao *BaseDao[T]) Create(model *T) error + func (dao *BaseDao[T]) CreateList(list []T) error + func (dao *BaseDao[T]) DB() *gorm.DB + func (dao *BaseDao[T]) Delete(id uint64) error + func (dao *BaseDao[T]) DeleteCondition(condition string, args ...any) error + func (dao *BaseDao[T]) GetAll() ([]T, error) + func (dao *BaseDao[T]) GetCondition(query interface{}, args ...interface{}) (*T, error) + func (dao *BaseDao[T]) GetConditions(query interface{}, args ...interface{}) ([]T, error) + func (dao *BaseDao[T]) GetConditionsLimit(maxCount int, query interface{}, args ...interface{}) ([]*T, error) + func (dao *BaseDao[T]) GetList(startId uint64, maxCount int) ([]T, error) + func (dao *BaseDao[T]) GetModel(id uint64) (*T, error) + func (dao *BaseDao[T]) Save(model *T) error + func (dao *BaseDao[T]) Update(model *T) error + type Context interface + GetBool func(key string) bool + GetByte func(key string) byte + GetDate func(key string) Date + GetDateTime func(key string) DateTime + GetFiles func(key string) []File + GetInt func(key string) int + GetString func(key string) string + GetStruct func(refStruct any) + GetUInt func(key string) uint64 + Raw func() any + type Date uint32 + func NewDate(t time.Time) Date + func (d *Date) UnmarshalJSON(data []byte) error + func (d Date) MarshalJSON() ([]byte, error) + func (d Date) ToString() string + func (d Date) ToTime() time.Time + type DateTime uint64 + func NewDateTime(t time.Time) DateTime + func (d *DateTime) UnmarshalJSON(data []byte) error + func (d DateTime) MarshalJSON() ([]byte, error) + func (d DateTime) ToString() string + func (d DateTime) ToTime() time.Time + type DbFull struct + FullInfo string + Id uint64 + LastTime DateTime + Summary string + type DbSimple struct + Id uint64 + LastTime DateTime + type File struct + Data []byte + Name string + Size int64