Documentation ¶
Index ¶
- Constants
- func EndCallback(db *gorm.DB, mod string)
- func EndCallbackReq(db *gorm.DB, mod string) *crawler.Request
- func GetById[T any](db *gorm.DB, id int) (*T, error)
- func GetDB(db *gorm.DB, log *log.Logger, conf *logger.Config) *gorm.DB
- func NewTraceDB(db *gorm.DB, ctx context.Context, traceId string) *gorm.DB
- type ChainDao
- type Config
- type Cursor
- type DB
- type DB2
- type FilterExpressions
- type ModelTime
- type PrometheusConfig
- type Repository
Constants ¶
View Source
const ( MYSQL = "mysql" POSTGRES = "postgres" SQLite = "sqlite3" )
Variables ¶
This section is empty.
Functions ¶
func EndCallback ¶ added in v1.4.9
Types ¶
type Config ¶
type Config struct {
Type, Charset, Database, Schema, TimeZone string
Host string `flag:"name:db_host;usage:数据库host"`
Port int32
User, Password string
TimeFormat string
MaxIdleConns, MaxOpenConns int
GormConfig gorm.Config
EnableStdLogger bool
Logger logger.Config
NamingStrategy schema.NamingStrategy
EnablePrometheus bool
Prometheus prometheus.Config
PrometheusConfigs []PrometheusConfig
}
type Cursor ¶ added in v1.4.9
type FilterExpressions ¶
type FilterExpressions []dbi.FilterExpression
type PrometheusConfig ¶ added in v1.6.0
type Repository ¶
func NewRepository ¶
func (*Repository[T]) Create ¶
func (r *Repository[T]) Create(t *T) error
func (*Repository[T]) Delete ¶
func (r *Repository[T]) Delete(id int) error
func (*Repository[T]) Read ¶
func (r *Repository[T]) Read(id int) (*T, error)
func (*Repository[T]) Update ¶
func (r *Repository[T]) Update(t *T) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.