Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIDRequired = errors.New("cannot execute query without an id stored on the model") ErrLinkRequired = errors.New("cannot fetch epistle information without a link") ErrMissingPageSize = errors.New("missing page size in paginated query") ErrAlreadyExists = errors.New("reading already exists") ErrEpistleIDMismatch = errors.New("cannot update a reading with the wrong epistle id") )
Functions ¶
Types ¶
type Epistle ¶
type Epistle struct { ID int64 Link string Title sql.NullString Description sql.NullString Favicon sql.NullString Created time.Time Modified time.Time }
Database model for an Epistle object
type Reading ¶
type Reading struct { EpistleID int64 UserID int64 Status Status Started sql.NullTime Finished sql.NullTime Archived sql.NullTime Created time.Time Modified time.Time // contains filtered or unexported fields }
Database model for a reading object.
func List ¶
func List(ctx context.Context, userID int64, prevPage *pagination.Cursor) (r []*Reading, cursor *pagination.Cursor, err error)
List readings for the specified user.
func (*Reading) Epistle ¶
Epistle returns the epistle associated with the reading. If the epistle is not cached on the struct then a database query is performed and an error may be returned. Use the reset bool to force a database query even if the epistle is cached on the struct.
Click to show internal directories.
Click to hide internal directories.