quote

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Quotation

type Quotation struct {
	Quote  string
	Author string
}

Quotation contains the data of a single quote

func (*Quotation) WriteHTML

func (q *Quotation) WriteHTML(w io.Writer) error

func (*Quotation) WriteJSON

func (q *Quotation) WriteJSON(w io.Writer) error

type QuoteBook

type QuoteBook struct {
	sync.Mutex
	// contains filtered or unexported fields
}

QuoteBook is a collection of Quotations

func New

func New() *QuoteBook

func (*QuoteBook) AddQuote

func (q *QuoteBook) AddQuote(quote Quotation) error

func (*QuoteBook) FillExample

func (q *QuoteBook) FillExample()

func (*QuoteBook) GetQuote

func (q *QuoteBook) GetQuote(num int) (*Quotation, error)

func (*QuoteBook) RandomQuotation

func (q *QuoteBook) RandomQuotation() (*Quotation, error)

Jump to

Keyboard shortcuts

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