example

package
v0.0.0-...-225f367 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB(dsn string)

InitDB inits a global db instance.

func InsertUserProfile

func InsertUserProfile(profile *UserProfile) error

InsertUserProfile insert a new record.

Types

type UserProfile

type UserProfile struct {
	ID       uint64 `gorm:"column:id;primaryKey:autoIncrement"`
	Username string `gorm:"column:username"`
	Email    string `gorm:"column:email"`
}

UserProfile user profile table

func GetUserProfiles

func GetUserProfiles() ([]*UserProfile, error)

GetUserProfiles get all user profiles.

func (UserProfile) TableName

func (UserProfile) TableName() string

TableName returns the table name.

Jump to

Keyboard shortcuts

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