model

package
v0.0.0-...-48c7a0b Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

Functions

func AddBlog

func AddBlog(n Blog) (bool, error)

func ConnectDatabase

func ConnectDatabase() error

func DeleteBlog

func DeleteBlog(id int) (bool, error)

func UpdateBlog

func UpdateBlog(n Blog, id int) (bool, error)

Types

type Blog

type Blog struct {
	Id      int    `json:"id"`
	Author  string `json:"author"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Image   string `json:"image"`
	Ctime   string `json:"ctime"`
}

func GetBlogById

func GetBlogById(id string) (Blog, error)

func GetBlogs

func GetBlogs() ([]Blog, error)

Jump to

Keyboard shortcuts

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