infra

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDataBase

type IDataBase interface {
	// master ReadWrite Node
	Master() *gorm.DB
	// slave ReadOnly Node
	Slave() *gorm.DB
}

IDataBase ReadWrite/ReadOnly オブジェクトインターフェイス

func New

func New() IDataBase

New DB接続

Environments

DB_MASTER_NAME: Database host for readwrite

DB_SLAVE_NAME: Database host for readonly

DB_USER: Username

DB_PASSWORD: password

DB_PORT: database port number

DB_DBNAME: database name

DB_SCHEMA: schema name

REPLICA: Y: ReadWrite and ReadOnly

DB_LOG: Y: gorm.LogMode -> true

func NewDB added in v0.0.3

func NewDB(dialect, dsn, slavedsn string) IDataBase

NewDB DB接続

Environments

REPLICA: Y: ReadWrite and ReadOnly

DB_LOG: Y: gorm.LogMode -> true

type RepositoryImple

type RepositoryImple struct {
	Master *gorm.DB
	Slave  *gorm.DB
}

Jump to

Keyboard shortcuts

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