store

package
v0.0.0-...-c514b93 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetItemByAverageStepAsc

func GetItemByAverageStepAsc(db *gorm.DB, tableName string) ([]sol.Record, error)

func InsertItem

func InsertItem(db *gorm.DB, tableName string, item interface{}) error

func NewDB

func NewDB(opts ...Option) *gorm.DB

Types

type Dsn

type Dsn struct {
	User     string
	Password string
	Schema   string
	Host     string
	Proto    string

	// options
	MaxOpenConn int
	MaxIdle     int
	MaxLifeTime time.Duration
	LogLevel    logger.LogLevel

	Options map[string]string
}

func NewDsn

func NewDsn(opts ...Option) *Dsn

type Option

type Option func(*Dsn)

func Charset

func Charset(charset string) Option

func Host

func Host(host string) Option

func Loc

func Loc(loc string) Option

func LogLevel

func LogLevel(level string) Option

func MaxIdle

func MaxIdle(maxIdle int) Option

func MaxLifeTime

func MaxLifeTime(maxLifeTime time.Duration) Option

func MaxOpenConn

func MaxOpenConn(maxOpenConn int) Option

func ParseTime

func ParseTime(parseTime string) Option

func Password

func Password(password string) Option

func Proto

func Proto(proto string) Option

func Schema

func Schema(schema string) Option

func User

func User(user string) Option

Jump to

Keyboard shortcuts

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