dal

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 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 BaseModel

type BaseModel struct {
	ID        int64          `gorm:"column:id"`
	CreatedAt time.Time      `gorm:"column:created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at"`
}

type Client

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

func New

func New(db *gorm.DB) *Client

func (*Client) CreateEntries

func (r *Client) CreateEntries(pos []*ModelEntry) error

func (*Client) CreateFeed

func (r *Client) CreateFeed(feedURL, homeURL string) (*ModelFeed, error)

func (*Client) CreateUser

func (r *Client) CreateUser(username, password string) error

func (*Client) CreateUserEntries

func (r *Client) CreateUserEntries(pos []*ModeUserEntryRelation) error

func (*Client) CreateUserFeed

func (r *Client) CreateUserFeed(userID, feedID int64, title string) error

func (*Client) DeleteUserFeed

func (r *Client) DeleteUserFeed(userID, feedID int64) error

func (*Client) DeleteUserFeedTag

func (r *Client) DeleteUserFeedTag(userID int64, tagName string) error

func (*Client) GetFeedByURL

func (r *Client) GetFeedByURL(url string) (*ModelFeed, error)

func (*Client) GetUser

func (r *Client) GetUser(username string) (*ModelUser, error)

func (*Client) GetUserEntryLatestID

func (r *Client) GetUserEntryLatestID(userID int64) (int64, error)

func (*Client) ListEntryByLatestID

func (r *Client) ListEntryByLatestID(feedIDs []int64, latestEntryID int64, limit int) ([]*ModelEntry, error)

func (*Client) ListFeedURL

func (r *Client) ListFeedURL() ([]string, error)

func (*Client) ListFeedUserIDs

func (r *Client) ListFeedUserIDs(feedID int64) ([]int64, error)

func (*Client) ListUserEntry

func (r *Client) ListUserEntry(userID int64, readed, starred *bool, feedID *string, count int) ([]*ModeUserEntryRelation, error)

func (*Client) ListUserFeed

func (r *Client) ListUserFeed(userID int64) ([]*ModelUserFeedRelation, error)

func (*Client) ListUserFeedIDs

func (r *Client) ListUserFeedIDs(userID int64) ([]int64, error)

func (*Client) ListUserFeedTagNames

func (r *Client) ListUserFeedTagNames(userID int64, feedIDs []int64) (map[int64]string, error)

func (*Client) ListUserTagNames

func (r *Client) ListUserTagNames(userID int64) ([]string, error)

func (*Client) Login

func (r *Client) Login(username, password string) (string, error)

func (*Client) MGetEntry

func (r *Client) MGetEntry(ids []int64) (map[int64]*ModelEntry, error)

func (*Client) MGetFeed

func (r *Client) MGetFeed(ids []int64) (map[int64]*ModelFeed, error)

func (*Client) RenameUserFeedTag

func (r *Client) RenameUserFeedTag(userID int64, oldTag, newTag string) error

func (*Client) UpdateUserEntryOffset

func (r *Client) UpdateUserEntryOffset(userID, latest int64) error

func (*Client) UpdateUserEntryStatus

func (r *Client) UpdateUserEntryStatus(userID int64, ids []int64, read, star *bool) error

func (*Client) UpdateUserFeedTag

func (r *Client) UpdateUserFeedTag(userID, feedID int64, newTag string) error

func (*Client) UpdateUserFeedTitle

func (r *Client) UpdateUserFeedTitle(userID, feedID int64, newTitle string) error

type ModeUserEntryOffset

type ModeUserEntryOffset struct {
	BaseModel
	UserID int64 `gorm:"column:user_id"`
	// FeedID int64 `gorm:"column:feed_id"`
	Latest int64 `gorm:"column:latest"`
}

func (ModeUserEntryOffset) TableName

func (ModeUserEntryOffset) TableName() string

type ModeUserEntryRelation

type ModeUserEntryRelation struct {
	BaseModel
	UserID  int64 `gorm:"column:user_id"`
	FeedID  int64 `gorm:"column:feed_id"`
	EntryID int64 `gorm:"column:entry_id"`
	Readed  bool  `gorm:"column:readed"`
	Starred bool  `gorm:"column:starred"`
}

func (ModeUserEntryRelation) TableName

func (ModeUserEntryRelation) TableName() string

type ModelEntry

type ModelEntry struct {
	BaseModel

	FeedID int64  `gorm:"column:feed_id"`
	Title  string `gorm:"column:title"`
	URL    string `gorm:"column:url"`
	Author string `gorm:"column:author"`
}

func (ModelEntry) TableName

func (ModelEntry) TableName() string

type ModelFeed

type ModelFeed struct {
	BaseModel
	FeedURL     string `gorm:"column:feed_url"`
	HomePageURL string `gorm:"column:home_url"`
}

func (ModelFeed) TableName

func (ModelFeed) TableName() string

type ModelUser

type ModelUser struct {
	BaseModel
	Username string `gorm:"column:username"`
	Hash     string `gorm:"column:hash"`
}

func (ModelUser) TableName

func (ModelUser) TableName() string

type ModelUserFeedRelation

type ModelUserFeedRelation struct {
	BaseModel
	UserID  int64  `gorm:"column:user_id"`
	FeedID  int64  `gorm:"column:feed_id"`
	TagName string `gorm:"column:tag_name"`
	Title   string `gorm:"column:title"`
}

func (ModelUserFeedRelation) TableName

func (ModelUserFeedRelation) TableName() string

Jump to

Keyboard shortcuts

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