database

package
v0.0.0-...-71458e1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddFeedParams

type AddFeedParams struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	Name      string
	Url       string
	UserID    uuid.UUID
}

type CreateFeedFollowParams

type CreateFeedFollowParams struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	UserID    uuid.UUID
	FeedID    uuid.UUID
}

type CreateFeedFollowRow

type CreateFeedFollowRow struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	UserID    uuid.UUID
	FeedID    uuid.UUID
	UserName  string
	FeedName  string
}

type CreatePostParams

type CreatePostParams struct {
	ID          uuid.UUID
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Title       string
	Url         string
	Description sql.NullString
	PublishedAt sql.NullTime
	FeedID      uuid.UUID
}

type CreateUserParams

type CreateUserParams struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	Name      string
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteFeedFollowParams

type DeleteFeedFollowParams struct {
	UserID uuid.UUID
	FeedID uuid.UUID
}

type Feed

type Feed struct {
	ID            uuid.UUID
	CreatedAt     time.Time
	UpdatedAt     time.Time
	Name          string
	Url           string
	UserID        uuid.UUID
	LastFetchedAt sql.NullTime
}

type FeedFollow

type FeedFollow struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	UserID    uuid.UUID
	FeedID    uuid.UUID
}

type GetFeedByURLRow

type GetFeedByURLRow struct {
	ID   uuid.UUID
	Name string
}

type GetFeedsFollowForUserRow

type GetFeedsFollowForUserRow struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	UserID    uuid.UUID
	FeedID    uuid.UUID
	UserName  string
	FeedName  string
}

type GetFeedsRow

type GetFeedsRow struct {
	Name     string
	Url      string
	Username string
}

type GetNextFeedToFetchRow

type GetNextFeedToFetchRow struct {
	ID  uuid.UUID
	Url string
}

type GetPostsForUserParams

type GetPostsForUserParams struct {
	UserID uuid.UUID
	Limit  int32
}

type GetPostsForUserRow

type GetPostsForUserRow struct {
	ID          uuid.UUID
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Title       string
	Url         string
	Description sql.NullString
	PublishedAt sql.NullTime
	FeedID      uuid.UUID
	FeedName    string
}

type MarkFeedFetchedParams

type MarkFeedFetchedParams struct {
	LastFetchedAt sql.NullTime
	UpdatedAt     time.Time
	ID            uuid.UUID
}

type Post

type Post struct {
	ID          uuid.UUID
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Title       string
	Url         string
	Description sql.NullString
	PublishedAt sql.NullTime
	FeedID      uuid.UUID
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddFeed

func (q *Queries) AddFeed(ctx context.Context, arg AddFeedParams) (Feed, error)

func (*Queries) CreateFeedFollow

func (q *Queries) CreateFeedFollow(ctx context.Context, arg CreateFeedFollowParams) (CreateFeedFollowRow, error)

func (*Queries) CreatePost

func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) error

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteFeedFollow

func (q *Queries) DeleteFeedFollow(ctx context.Context, arg DeleteFeedFollowParams) error

func (*Queries) GetFeedByURL

func (q *Queries) GetFeedByURL(ctx context.Context, url string) (GetFeedByURLRow, error)

func (*Queries) GetFeeds

func (q *Queries) GetFeeds(ctx context.Context) ([]GetFeedsRow, error)

func (*Queries) GetFeedsFollowForUser

func (q *Queries) GetFeedsFollowForUser(ctx context.Context, name string) ([]GetFeedsFollowForUserRow, error)

func (*Queries) GetNextFeedToFetch

func (q *Queries) GetNextFeedToFetch(ctx context.Context, name string) (GetNextFeedToFetchRow, error)

func (*Queries) GetPostsForUser

func (q *Queries) GetPostsForUser(ctx context.Context, arg GetPostsForUserParams) ([]GetPostsForUserRow, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, name string) (User, error)

func (*Queries) GetUsers

func (q *Queries) GetUsers(ctx context.Context) ([]string, error)

func (*Queries) MarkFeedFetched

func (q *Queries) MarkFeedFetched(ctx context.Context, arg MarkFeedFetchedParams) error

func (*Queries) ResetUsers

func (q *Queries) ResetUsers(ctx context.Context) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type User

type User struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	Name      string
}

Jump to

Keyboard shortcuts

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