db

package
v0.0.0-...-4571b1c Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() (gorm.DB, error)

func CreateCategory

func CreateCategory(category Category, db gorm.DB)

func CreateTag

func CreateTag(tag Tag, db gorm.DB)

Types

type Category

type Category struct {
	Id   string
	Name string `json:"name"`
}

func GetCategory

func GetCategory(id string, db gorm.DB) (Category, bool)

func ListCategories

func ListCategories(db gorm.DB) []Category

type Tag

type Tag struct {
	Id         string
	CategoryId string `json:"category_id"`
	Name       string `json:"name"`
}

func GetTag

func GetTag(id string, db gorm.DB) (Tag, bool)

func ListTags

func ListTags(db gorm.DB) []Tag

Jump to

Keyboard shortcuts

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