repo

package
v0.0.0-...-71617dc Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func CreateDB

func CreateDB() *DB

func (*DB) BeginTx

func (db *DB) BeginTx() Tx

func (*DB) DeleteExpiredSessions

func (db *DB) DeleteExpiredSessions()

func (*DB) DeleteSessionByToken

func (db *DB) DeleteSessionByToken(token string)

func (*DB) DeleteUsersFeeds

func (db *DB) DeleteUsersFeeds(userId, feedId int)

func (*DB) ExistsByFeedURL

func (db *DB) ExistsByFeedURL(userID int, feedURL string) (exists bool)

func (*DB) GetAllFeedURLsByUsername

func (db *DB) GetAllFeedURLsByUsername(username string) (feedURLs []string)

func (*DB) GetAllFeeds

func (db *DB) GetAllFeeds() (feeds []Feed)

func (*DB) GetAllItemsByFeedID

func (db *DB) GetAllItemsByFeedID(feedID int) (items []Item)

func (*DB) GetFeedByID

func (db *DB) GetFeedByID(feedID int) (feed *Feed, ok bool)

func (*DB) GetItemsByUserId

func (db *DB) GetItemsByUserId(userID int) (items []Item)

func (*DB) GetSessionByToken

func (db *DB) GetSessionByToken(token string) (session *Session, ok bool)

func (*DB) GetUserById

func (db *DB) GetUserById(userID int) (user *User, ok bool)

func (*DB) GetUserByUsername

func (db *DB) GetUserByUsername(username string) (user *User, ok bool)

func (*DB) GetUserFirst

func (db *DB) GetUserFirst() (user *User, ok bool)

func (*DB) InsertSession

func (db *DB) InsertSession(session *Session) (token string, ok bool)

func (*DB) InsertUser

func (db *DB) InsertUser(user *User)

func (*DB) RemoveItem

func (db *DB) RemoveItem(itemID int)

type Feed

type Feed struct {
	ID        int
	Name      string
	Source    string
	FeedLink  string
	UpdatedAt string
	Items     []Item
}

type Item

type Item struct {
	ID      int
	Source  string
	Title   string
	PubDate string

	FeedID     int
	FeedName   string
	FeedSource string
}

type Session

type Session struct {
	Token  string
	Expiry time.Time
	UserID int
}

type Tx

type Tx struct {
	*sql.Tx
	// contains filtered or unexported fields
}

func (*Tx) InsertFeed

func (tx *Tx) InsertFeed(feed *Feed) (updatedFeed *Feed)

func (*Tx) InsertItem

func (tx *Tx) InsertItem(item *Item)

func (*Tx) InsertUsersFeeds

func (tx *Tx) InsertUsersFeeds(userId, feedId int)

type User

type User struct {
	ID       int
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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