Documentation ¶ Index ¶ type Config type Option func WithLogger(logger logger.Interface) Option func WithTrace(tracer gorm.Plugin) Option type Orm func NewOrm(cfg *Config, opts ...Option) (orm *Orm, err error) func (orm *Orm) UseRead() *gorm.DB func (orm *Orm) UseWrite() *gorm.DB Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Config ¶ type Config struct { ServiceName string Master *instanceConfig Slave *instanceConfig } type Option ¶ type Option func(orm *Orm) func WithLogger ¶ func WithLogger(logger logger.Interface) Option func WithTrace ¶ func WithTrace(tracer gorm.Plugin) Option type Orm ¶ type Orm struct { *gorm.DB // contains filtered or unexported fields } func NewOrm ¶ func NewOrm(cfg *Config, opts ...Option) (orm *Orm, err error) func (*Orm) UseRead ¶ func (orm *Orm) UseRead() *gorm.DB func (*Orm) UseWrite ¶ func (orm *Orm) UseWrite() *gorm.DB Source Files ¶ View all Source files orm.go Click to show internal directories. Click to hide internal directories.