db

package
v0.0.0-...-049319c Latest Latest
Warning

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

Go to latest
Published: Jan 7, 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(user string, password string, host string, port string, database string)

func NewDB

func NewDB(host string, port string, user string, password string, database string) *gorm.DB

Types

type Author

type Author struct {
	ID   int
	Name string
}

type Post

type Post struct {
	gorm.Model
	Name     string
	AuthorID int
	Author   Author
	Tags     []Tag `gorm:"many2many:post_tags"`
}

type Tag

type Tag struct {
	gorm.Model
	Name string
}

Jump to

Keyboard shortcuts

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