database

package
v0.0.0-...-7955bae Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthUser

func AuthUser(u *models.User) (bool, error)

func DBInit

func DBInit(dialector gorm.Dialector, gconf *gorm.Config)

func GetBoxPrice

func GetBoxPrice() float32

func GetDB

func GetDB() *gorm.DB

func GetPublicKey

func GetPublicKey() string

func GetStickerPrice

func GetStickerPrice() float32

func InsertContact

func InsertContact(o *models.TableContact) bool

func InsertOrder

func InsertOrder(o *models.TableOrder) bool

func InsertRawUser

func InsertRawUser(u *models.User) bool

func InsertUseCase

func InsertUseCase(o *models.TableUseCase) bool

func InsertUser

func InsertUser(o *models.TableUser) bool

func LoadSettings

func LoadSettings(profile string)

func OrderHasValidPrice

func OrderHasValidPrice(o *models.TableOrder) bool

func SaveSettings

func SaveSettings() error

func SetBoxPrice

func SetBoxPrice(newPrice float32)

func SetPublicKey

func SetPublicKey(nv string) error

func SetStickerPrice

func SetStickerPrice(newPrice float32)

Types

type DBConfig

type DBConfig interface {
	GetDSN() string
}

type PostgresDBConf

type PostgresDBConf struct {
	// "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai"
	DatabaseHost     string
	DatabaseUser     string
	DatabasePassword string
	DatabaseName     string
	DatabasePort     uint
	Others           map[string]interface{}
}

func (*PostgresDBConf) GetDSN

func (conf *PostgresDBConf) GetDSN() string

type SqliteDBConf

type SqliteDBConf struct {
	DatabasePath string
}

func (*SqliteDBConf) GetDSN

func (conf *SqliteDBConf) GetDSN() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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