database

package
v0.0.0-...-8c928bc Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateFeedFollowParams

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

type CreateFeedParams

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

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 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
	FeedID    uuid.UUID
	UserID    uuid.UUID
}

type GetPostsByUserParams

type GetPostsByUserParams struct {
	UserID uuid.UUID
	Limit  int32
}

type MarkFeedFetchedParams

type MarkFeedFetchedParams struct {
	CreatedAt 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 GetQueries

func GetQueries() *Queries

func New

func New(db DBTX) *Queries

func (*Queries) CreateFeed

func (q *Queries) CreateFeed(ctx context.Context, arg CreateFeedParams) (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, id uuid.UUID) error

func (*Queries) GetFeeds

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

func (*Queries) GetNextFeedsToFetch

func (q *Queries) GetNextFeedsToFetch(ctx context.Context, limit int32) ([]Feed, error)

func (*Queries) GetPostsByUser

func (q *Queries) GetPostsByUser(ctx context.Context, arg GetPostsByUserParams) ([]Post, error)

func (*Queries) GetUser

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

func (*Queries) GetUserFeedFollows

func (q *Queries) GetUserFeedFollows(ctx context.Context, userID uuid.UUID) ([]Feedfollow, error)

func (*Queries) MarkFeedFetched

func (q *Queries) MarkFeedFetched(ctx context.Context, arg MarkFeedFetchedParams) (int64, 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
	ApiKey    string
}

Jump to

Keyboard shortcuts

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