sqldb

package
v0.0.0-...-edfbc91 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client *gorm.DB

Functions

func Init

func Init(opt *ConOptions)

Types

type Common

type Common[t model.Interface] struct {
}

func (*Common[t]) Create

func (c *Common[t]) Create(obj t) error

func (*Common[t]) Delete

func (c *Common[t]) Delete(obj model.Interface) error

func (*Common[t]) Get

func (c *Common[t]) Get(obj model.Interface) (*t, error)

func (*Common[t]) Update

func (c *Common[t]) Update(obj model.Interface) error

type ConOptions

type ConOptions struct {
	Address         string `yaml:"address"`
	Username        string `yaml:"username"`
	Password        string `yaml:"password"`
	Database        string `yaml:"database"`
	MaxIdleConns    int    `yaml:"maxIdleConns"`
	MaxOpenConns    int    `yaml:"maxOpenConns"`
	ConnMaxLifetime int    `yaml:"connMaxLifetime"`
	AutoMigrate     bool   `yaml:"autoMigrateh"`
}

Jump to

Keyboard shortcuts

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