review

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_STAR = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type Review

type Review struct {
	Book        *entity.Book
	Date        values.Date
	Rating      int
	Star        [MAX_STAR]bool
	Description string `json:",omitempty"`
}

Review is entity class for review info.

func New

func New(book *entity.Book, opts ...ReviewOptFunc) *Review

func (*Review) CopyFrom

func (r *Review) CopyFrom(src *Review) *Review

func (*Review) Format

func (r *Review) Format(tmpltPath string) ([]byte, error)

func (*Review) SetRating

func (rev *Review) SetRating(r int) *Review

SetRating sets rating value of book

func (*Review) String

func (r *Review) String() string

type ReviewOptFunc

type ReviewOptFunc func(*Review)

LookupOptFunc is self-referential function for functional options pattern

func WithBookCover

func WithBookCover(url string) ReviewOptFunc

WithBookCover returns function for setting IdType

func WithBookPage

func WithBookPage(url string) ReviewOptFunc

WithBookPage returns function for setting IdType

func WithDate

func WithDate(s string) ReviewOptFunc

WithDate returns function for setting IdType

func WithDescription

func WithDescription(s string) ReviewOptFunc

WithDate returns function for setting IdType

func WithRating

func WithRating(r int) ReviewOptFunc

WithRating returns function for setting IdType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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