guestbook

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GuestbookHandler

type GuestbookHandler struct{}

Handler Implements types.HandlerRegistrar interface

func (*GuestbookHandler) Handler

func (h *GuestbookHandler) Handler(engine *gin.Engine)

Handler Handler Implements RouteRegistrar interface

func (*GuestbookHandler) Initialize

func (h *GuestbookHandler) Initialize(initContext *types.HandlerInitContext)

Initialize is called before the handler is registered

type MessageDisplay

type MessageDisplay struct {
	Name      string
	Message   string
	CreatedAt string
}

func NewMessageDisplay

func NewMessageDisplay(row Row) MessageDisplay

func NewMessageDisplaySlice

func NewMessageDisplaySlice(rows []Row) []MessageDisplay

type Repository

type Repository struct{}

func (*Repository) GetRecent

func (r *Repository) GetRecent(db *sqlx.DB, amount int) ([]Row, error)

func (*Repository) Insert

func (r *Repository) Insert(db *sqlx.DB, name string, message string) error

type Row

type Row struct {
	ID        uint      `db:"id"`
	Name      string    `db:"name"`
	Message   string    `db:"message"`
	CreatedAt time.Time `db:"created_at"`
}

Jump to

Keyboard shortcuts

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