post

package
v0.0.0-...-661d740 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBInterface

type DBInterface interface {
	Prepare(query string) (*sql.Stmt, error)
	Exec(query string, args ...interface{}) (sql.Result, error)
	Query(query string, args ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...interface{}) *sql.Row
	Close() error
}

type Post

type Post struct {
	ID      int    `json:"id"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Date    string `json:"date"`
}

type PostHandler

type PostHandler struct {
	// contains filtered or unexported fields
}

func NewPostHandler

func NewPostHandler(db DBInterface) *PostHandler

func (*PostHandler) CreatePost

func (ph *PostHandler) CreatePost(c echo.Context) error

func (*PostHandler) DeletePost

func (ph *PostHandler) DeletePost(c echo.Context) error

func (*PostHandler) EditPost

func (ph *PostHandler) EditPost(c echo.Context) error

func (*PostHandler) GetPosts

func (ph *PostHandler) GetPosts(c echo.Context) error

Jump to

Keyboard shortcuts

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