dborm

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 12 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *gorm.DB

Functions

func Connect

func Connect(args *Config)

func Destroy added in v0.3.5

func Destroy() error

func NewLogger

func NewLogger() logger.Interface

func OrderSafe

func OrderSafe(data string) error

Types

type Config

type Config struct {
	Type     string `note:"数据库类型"`
	Host     string `note:"主机地址"`
	User     string `note:"用户名"`
	Password string `note:"用户密码"`
	DbName   string `note:"数据库名称"`
	Option   string `note:"数据库选项"`
}

type Logger

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

func (Logger) Error

func (l Logger) Error(ctx context.Context, msg string, args ...any)

func (Logger) Info

func (l Logger) Info(ctx context.Context, msg string, args ...any)

func (Logger) LogMode

func (l Logger) LogMode(level logger.LogLevel) logger.Interface

func (Logger) Trace

func (l Logger) Trace(ctx context.Context, begin time.Time, fn func() (string, int64), err error)

func (Logger) Warn

func (l Logger) Warn(ctx context.Context, msg string, args ...any)

Jump to

Keyboard shortcuts

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