database

package
v0.0.0-...-480c846 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT 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
	LastFetchedAt sql.NullTime
	UserID        uuid.UUID
}

type CreateFeedFollowParams

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

type CreatePostParams

type CreatePostParams struct {
	ID          uuid.UUID
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Title       string
	Url         string
	Description string
	PublishedAt time.Time
	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 {
	FeedID uuid.UUID
	UserID uuid.UUID
}

type Feed

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

type FeedFollow

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

type GetAllFeedsRow

type GetAllFeedsRow struct {
	Name   string
	Url    string
	Name_2 string
}

type GetFeedFollowsForUserRow

type GetFeedFollowsForUserRow struct {
	Name   string
	Name_2 string
}

type GetFeedIDUserIDfromFollowsParams

type GetFeedIDUserIDfromFollowsParams struct {
	Name string
	Url  string
}

type GetFeedIDUserIDfromFollowsRow

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

type GetFeedNamebyURLRow

type GetFeedNamebyURLRow struct {
	Name string
	ID   uuid.UUID
}

type GetFeedParams

type GetFeedParams struct {
	Name   string
	UserID uuid.UUID
}

type GetPostsForUserParams

type GetPostsForUserParams struct {
	Name  string
	Limit int32
}

type GetPostsForUserRow

type GetPostsForUserRow struct {
	Name        string
	Title       string
	Url         string
	Description string
	PublishedAt time.Time
}

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 string
	PublishedAt time.Time
	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) (FeedFollow, error)

func (*Queries) CreatePost

func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) (Post, 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) GetAllFeeds

func (q *Queries) GetAllFeeds(ctx context.Context) ([]GetAllFeedsRow, error)

func (*Queries) GetFeed

func (q *Queries) GetFeed(ctx context.Context, arg GetFeedParams) (string, error)

func (*Queries) GetFeedFollowsForUser

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

func (*Queries) GetFeedNamebyURL

func (q *Queries) GetFeedNamebyURL(ctx context.Context, url string) (GetFeedNamebyURLRow, error)

func (*Queries) GetNextFeedToFetch

func (q *Queries) GetNextFeedToFetch(ctx context.Context, name string) (string, 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) (string, error)

func (*Queries) GetUserUUID

func (q *Queries) GetUserUUID(ctx context.Context, name string) (uuid.UUID, 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