Versions in this module Expand all Collapse all v0 v0.8.10 Oct 24, 2024 v0.8.9 Oct 23, 2024 v0.8.8 Oct 23, 2024 v0.8.7 Oct 23, 2024 Changes in this version type URL + IsAlive bool v0.8.5 Oct 22, 2024 v0.7.1 Oct 17, 2024 Changes in this version + const QueryArgStr + const QueryDeletePage + const QueryDeleteURL + const QueryGetAllMonitoredURL + const QueryGetAllPageByURL + const QueryGetAllURL + const QueryGetLatestPagesCount + const QueryGetLatestPagesPaginated + const QueryGetPageById + const QueryGetURLById + const QueryGetURLByURL + const QueryInsertPage + const QueryInsertURL + const QuerySelectPage + const QuerySelectURL + const QueryUpdateURL + var DefaultDBTimeout = 5 * time.Second + var ErrEditConflict = errors.New("models: edit conflict") + var ErrInvalidOrderBy = errors.New("models: invalid order by") + var ErrNullURL = errors.New("models: url cannot be empty or null") + var ErrRecordNotFound = errors.New("models: record not found") + var PageColumns = []string + var URLColumns = []string + func PageDelete(id int, query string, db *sql.DB) error + func PageGetLatestPageCount(ctx context.Context, baseurl *url.URL, markedURL string, cutoffDate time.Time, ...) (int, error) + func PageInsert(m *Page, query string, db *sql.DB) error + func URLDelete(id int, query string, db *sql.DB) error + func URLInsert(m *URL, query string, db *sql.DB) error + func URLUpdate(m *URL, query string, db *sql.DB) error + func ValidOrderBy(orderBy string, validFields []string) bool + type Models struct + Pages PageModel + URLs URLModel + type Page struct + AddedAt time.Time + Content string + ID uint + URLID uint + func NewPage(urlId uint, content string) *Page + func PageGetAllByURL(urlID uint, orderBy string, query string, db *sql.DB) ([]*Page, error) + func PageGetById(id int, query string, db *sql.DB) (*Page, error) + type PageContent struct + AddedAt time.Time + Content string + URL string + func PageGetLatestPagesPaginated(ctx context.Context, baseurl *url.URL, markedURL string, cutoffDate time.Time, ...) ([]*PageContent, error) + type PageModel interface + Delete func(id int) error + GetAllByURL func(urlId uint, orderBy string) ([]*Page, error) + GetById func(id int) (*Page, error) + GetLatestPageCount func(ctx context.Context, baseURL *url.URL, markedURL string, cutoffDate time.Time) (int, error) + GetLatestPagesPaginated func(ctx context.Context, baseURL *url.URL, markedURL string, cutoffDate time.Time, ...) ([]*PageContent, error) + Insert func(*Page) error + type URL struct + FirstEncountered time.Time + ID uint + IsMonitored bool + LastChecked time.Time + LastSaved time.Time + URL string + Version uint + func NewURL(url string, lastChecked, lastSaved time.Time, isMonitored bool) *URL + func URLGetAll(orderBy string, query string, db *sql.DB) ([]*URL, error) + func URLGetById(id int, query string, db *sql.DB) (*URL, error) + func URLGetByURL(urlStr string, query string, db *sql.DB) (*URL, error) + type URLModel interface + Delete func(id int) error + GetAll func(orderBy string) ([]*URL, error) + GetAllMonitored func(orderBy string) ([]*URL, error) + GetById func(id int) (*URL, error) + GetByURL func(url string) (*URL, error) + Insert func(*URL) error + Update func(*URL) error