reddit

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listing

type Listing struct {
	Kind string `json:"kind"`
	Data struct {
		After    string `json:"after"`
		Children []struct {
			Kind string `json:"t3"`
			Data struct {
				Selftext         string  `json:"selftext"`
				LinkFlairText    string  `json:"link_flair_text"`
				Score            int     `json:"score"`
				CreatedUtc       float64 `json:"created_utc"`
				Title            string  `json:"title"`
				Hidden           bool    `json:"hidden"`
				Ups              int     `json:"ups"`
				Downs            int     `json:"downs"`
				Name             string  `json:"name"`
				Over18           bool    `json:"over_18"`
				ID               string  `json:"id"`
				Author           string  `json:"author"`
				NumberOfComments int     `json:"comments"`
				Permalink        string  `json:"permalink"`
			} `json:"data"`
		} `json:"children"`
		Before *string `json:"before"`
	} `json:"data"`
}

type Post

type Post struct {
	ID        string    `json:"id"`
	Ups       int       `json:"ups"`
	Downs     int       `json:"downs"`
	Title     string    `json:"title"`
	Comments  int       `json:"comments"`
	CreatedAt time.Time `json:"createdAt"`
	Score     int       `json:"score"`
}

type Reddit

type Reddit interface {
	GetPosts(ctx context.Context) (posts []*Post, err error)
}

func New

func New() Reddit

Jump to

Keyboard shortcuts

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