pg

package
v0.0.0-...-7c75739 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

func NewStorage

func NewStorage(pool *pgxpool.Pool, logger zerolog.Logger) *Storage

func (*Storage) AddProfilesToSubreddit

func (s *Storage) AddProfilesToSubreddit(ctx context.Context, subreddit string, profileIDs []int64) error

func (*Storage) CheckPresence

func (s *Storage) CheckPresence(ctx context.Context, postIDs []string) (map[string]struct{}, error)

func (*Storage) EnrichPosts

func (s *Storage) EnrichPosts(ctx context.Context, posts []reddit.PostAndComments) error

func (*Storage) GetAllSubredditSettings

func (s *Storage) GetAllSubredditSettings(ctx context.Context) ([]reddit.SubredditSettings, error)

func (*Storage) GetAllSubredditSettingsWithProfileID

func (s *Storage) GetAllSubredditSettingsWithProfileID(
	ctx context.Context,
	profileID int64,
) ([]reddit.SubredditSettings, error)

func (*Storage) GetPosts

func (s *Storage) GetPosts(ctx context.Context, postIDs []string) (posts []reddit.PostAndComments, err error)

func (*Storage) GetPostsForEnrichment

func (s *Storage) GetPostsForEnrichment(
	ctx context.Context,
	postCreatedBefore time.Time,
	limit int,
) (postIDs []string, err error)

func (*Storage) GetPostsForScheduling

func (s *Storage) GetPostsForScheduling(
	ctx context.Context,
	batchSize int,
	minScore int,
) (posts []reddit.PostAndComments, err error)

func (*Storage) GetRawPosts

func (s *Storage) GetRawPosts(ctx context.Context, postIDs []string) (posts []reddit.RawPostAndComments, err error)

func (*Storage) GetScheduledPostIDsFromSubreddits

func (s *Storage) GetScheduledPostIDsFromSubreddits(
	ctx context.Context,
	subreddits []string,
	days *int,
	limit *int,
) ([]string, error)

func (*Storage) GetSubredditsForScraping

func (s *Storage) GetSubredditsForScraping(ctx context.Context) (subreddits []string, err error)

func (*Storage) GetSubredditsSettings

func (s *Storage) GetSubredditsSettings(
	ctx context.Context,
	subreddits []string,
) (subredditsSettings []reddit.SubredditSettings, err error)

func (*Storage) InsertPosts

func (s *Storage) InsertPosts(ctx context.Context, posts []reddit.Post) error

func (*Storage) MarkPostsAsScheduled

func (s *Storage) MarkPostsAsScheduled(ctx context.Context, postIDs []string) error

func (*Storage) RemoveProfileFromAllSubredditSettings

func (s *Storage) RemoveProfileFromAllSubredditSettings(ctx context.Context, profileID int64) error

func (*Storage) RemoveProfilesFromSubreddit

func (s *Storage) RemoveProfilesFromSubreddit(ctx context.Context, subreddit string, profileIDs []int64) error

Jump to

Keyboard shortcuts

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