post

package
v0.0.0-...-2ba7617 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 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 AuthorPosts

type AuthorPosts struct {
	Author string
	Qty    int
}

AuthorPosts represents a count of posts created by a user.

func (*AuthorPosts) String

func (a *AuthorPosts) String() string

type Post

type Post struct {
	Title string
	Ups   int
}

Post represents a topic.

func (*Post) String

func (p *Post) String() string

type Service

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

func NewService

func NewService(client reddit.ListingFetcher, writer io.Writer) *Service

NewService instantiates a Post service responsible for updating and reporting statistics.

func (*Service) UpdateTopNAuthors

func (s *Service) UpdateTopNAuthors(ctx context.Context, subreddit string, num int) error

UpdateTopNAuthors fetches all posts in a subreddit to determine the top N most active posters.

func (*Service) UpdateTopPosts

func (s *Service) UpdateTopPosts(ctx context.Context, subreddit string) error

UpdateTopPosts fetches and reports the top posters for the provided subreddit.

Jump to

Keyboard shortcuts

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