db

package
v0.0.0-...-4c9bff6 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 2 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 {
	Conn conn.Database `mapstructure:"conn"`
}

type Connection

type Connection interface {
	ReadDB() *gorm.DB
	WriteDB() *gorm.DB
}

func NewConnection

func NewConnection(config Config) (Connection, error)

func NewRWConnection

func NewRWConnection(config RWConfig) (Connection, error)

type RWConfig

type RWConfig struct {
	Read  conn.Database `mapstructure:"read"`
	Write conn.Database `mapstructure:"write"`
}

type RWConnection

type RWConnection struct {
	// contains filtered or unexported fields
}

func (*RWConnection) ReadDB

func (conn *RWConnection) ReadDB() *gorm.DB

func (*RWConnection) WriteDB

func (conn *RWConnection) WriteDB() *gorm.DB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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