Versions in this module Expand all Collapse all v2 v2.0.2 Jul 2, 2026 Changes in this version + func SearchFunc[T any](ctx context.Context, dbConnection *gorm.DB, query *SearchQuery, ...) ([]T, error) v2.0.1 Jun 29, 2026 Changes in this version + const MemScheme + const MysqlScheme + const NatsScheme + const PostgresScheme + const RedisScheme + func ErrorConvertToAPI(err error) *connect.Error + func ErrorIsDuplicateKey(err error) bool + func ErrorIsNoRows(err error) bool + func StableSearch[T any](ctx context.Context, workMan workerpool.Manager, query *SearchQuery, ...) (workerpool.JobResultPipe[[]T], error) + type BaseModel struct + AccessID string + CreatedAt time.Time + CreatedBy string + DeletedAt gorm.DeletedAt + ID string + ModifiedAt time.Time + ModifiedBy string + PartitionID string + TenantID string + Version uint + func (model *BaseModel) BeforeCreate(db *gorm.DB) error + func (model *BaseModel) BeforeSave(db *gorm.DB) error + func (model *BaseModel) BeforeUpdate(db *gorm.DB) error + func (model *BaseModel) CopyPartitionInfo(parent *BaseModel) + func (model *BaseModel) GenID(ctx context.Context) + func (model *BaseModel) GetAccessID() string + func (model *BaseModel) GetID() string + func (model *BaseModel) GetPartitionID() string + func (model *BaseModel) GetTenantID() string + func (model *BaseModel) GetVersion() uint + func (model *BaseModel) SetAccessID(v string) + func (model *BaseModel) SetPartitionID(v string) + func (model *BaseModel) SetTenantID(v string) + func (model *BaseModel) ValidXID(id string) bool + type BaseModelI interface + GetID func() string + GetVersion func() uint + type DSN string + func (d DSN) ChangePort(newPort string) (DSN, error) + func (d DSN) DelPath() DSN + func (d DSN) ExtendPath(epath ...string) DSN + func (d DSN) ExtendQuery(key, value string) DSN + func (d DSN) GetQuery(key string) string + func (d DSN) IsCache() bool + func (d DSN) IsDB() bool + func (d DSN) IsMem() bool + func (d DSN) IsMySQL() bool + func (d DSN) IsNats() bool + func (d DSN) IsPostgres() bool + func (d DSN) IsQueue() bool + func (d DSN) IsRedis() bool + func (d DSN) PrefixPath(prefix string) DSN + func (d DSN) RemoveQuery(key ...string) DSN + func (d DSN) String() string + func (d DSN) SuffixPath(suffix string) DSN + func (d DSN) ToArray() []DSN + func (d DSN) ToURI() (*url.URL, error) + func (d DSN) Valid() bool + func (d DSN) WithPassword(password string) (DSN, error) + func (d DSN) WithPath(path string) (DSN, error) + func (d DSN) WithPathSuffix(suffix string) (DSN, error) + func (d DSN) WithQuery(query string) (DSN, error) + func (d DSN) WithUser(user string) (DSN, error) + func (d DSN) WithUserAndPassword(userName, password string) (DSN, error) + type JSONMap map[string]any + func (m *JSONMap) Copy() JSONMap + func (m *JSONMap) FromProtoStruct(s *structpb.Struct) JSONMap + func (m *JSONMap) GetFloat(key string) float64 + func (m *JSONMap) GetString(key string) string + func (m *JSONMap) GormDBDataType(db *gorm.DB, _ *schema.Field) string + func (m *JSONMap) GormDataType() string + func (m *JSONMap) GormValue(_ context.Context, db *gorm.DB) clause.Expr + func (m *JSONMap) MarshalJSON() ([]byte, error) + func (m *JSONMap) Scan(value any) error + func (m *JSONMap) ToProtoStruct() *structpb.Struct + func (m *JSONMap) UnmarshalJSON(data []byte) error + func (m *JSONMap) Update(update JSONMap) JSONMap + func (m *JSONMap) Value() (driver.Value, error) + type Paginator struct + BatchSize int + Limit int + Offset int + func (p *Paginator) CanLoad() bool + func (p *Paginator) SetBatchSize(batchSize int) + func (p *Paginator) Stop(loadedCount int) bool + type SearchOption func(*SearchQuery) + func WithSearchBatchSize(batchSize int) SearchOption + func WithSearchByTimePeriod(period *TimePeriod) SearchOption + func WithSearchFiltersAndByValue(filters map[string]any) SearchOption + func WithSearchFiltersOrByValue(filters map[string]any) SearchOption + func WithSearchLimit(limit int) SearchOption + func WithSearchOffset(offset int) SearchOption + type SearchQuery struct + FiltersAndByValue map[string]any + FiltersOrByValue map[string]any + OrderBy string + Pagination *Paginator + TimePeriod *TimePeriod + func NewSearchQuery(opts ...SearchOption) *SearchQuery + type TimePeriod struct + Field string + StartDate *time.Time + StopDate *time.Time + type UnitMeasure int64 + func (d *UnitMeasure) UnmarshalText(text []byte) error Other modules containing this package github.com/pitabwire/frame