Documentation ¶ Index ¶ Variables func AddBlog(n Blog) (bool, error) func ConnectDatabase() error func DeleteBlog(id int) (bool, error) func UpdateBlog(n Blog, id int) (bool, error) type Blog func GetBlogById(id string) (Blog, error) func GetBlogs() ([]Blog, error) 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) Source Files ¶ View all Source files blog.go Click to show internal directories. Click to hide internal directories.