db

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(db *gorm.DB) error

It is a function that closes the database connection.

func GetLogLevel

func GetLogLevel() logger.LogLevel

GetLogLevel returns the log level.

func Open

func Open() (*gorm.DB, error)

It is a function that opens the database connection.

func TimeNow

func TimeNow() time.Time

TimeNow returns the current time in the configured timezone.

func TimeNowString

func TimeNowString() string

TimeNowString returns the current time in the configured timezone as a string.

Types

type Cache

type Cache struct {
	ID    string `gorm:"<-:create,type:uuid;primary_key" json:"id"`
	Value string `gorm:"type:text;not null" json:"value"`

	CreatedAt time.Time `gorm:"type:timestamp;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"type:timestamp;not null" json:"updated_at"`
}

Cache is a struct that represents the cache table.

Jump to

Keyboard shortcuts

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