guestbook

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DateFormat = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	ID          int64     `json:"entry_id"`
	Created     time.Time `json:"created"`
	Name        string    `json:"name"`
	Website     string    `json:"website,omitempty"`
	Message     string    `json:"message"`
	HideWebsite bool      `json:"hide_website,omitempty"`
	Reply       *Reply    `json:"reply,omitempty"`
}

func NewEntry

func NewEntry(name, message, website string, hideWebsite bool) (*Entry, error)

type Guestbook

type Guestbook interface {
	Entries(page, pageSize int64) ([]*Entry, error)
	Count() (int64, error)
	NewEntry(entry *Entry) error
	UpdateEntry(entry *Entry) error
	DeleteEntry(entryID int64) error
	NewReply(reply *Reply) error
	UpdateReply(reply *Reply) error
	DeleteReply(entryID int64) error
	Close() error
}

type Reply

type Reply struct {
	ID      int64     `json:"-"`
	Created time.Time `json:"created,omitempty"`
	Message string    `json:"message"`
}

func NewReply

func NewReply(entryID int64, message string) (*Reply, error)

Jump to

Keyboard shortcuts

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