orm

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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