api

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	Id                  string
	Title               string
	Views               int64
	Upvotes             int64
	Downvotes           int64
	SharedWithCommunity bool
	CreatedAt           string
	UpdatedAt           string
	Comments            int64
	User                User
	Media               []Media
	Tags                []Tag
}

type Client

type Client struct {
	ClientID string
	Cache    *cache.Cache
}

func NewClient

func NewClient(clientId string) *Client

func (*Client) FetchAlbum

func (client *Client) FetchAlbum(albumID string) (Album, error)

func (*Client) FetchComments

func (client *Client) FetchComments(galleryID string) ([]Comment, error)

func (*Client) FetchMedia

func (client *Client) FetchMedia(mediaID string) (Album, error)

func (*Client) FetchPosts

func (client *Client) FetchPosts(albumID string) (Album, error)

func (*Client) FetchSubmissions

func (client *Client) FetchSubmissions(username string, sort string, page string) ([]Submission, error)

func (*Client) FetchTag

func (client *Client) FetchTag(tag string, sort string, page string) (Tag, error)

func (*Client) FetchTrending added in v1.1.0

func (client *Client) FetchTrending(section, sort, page string) ([]Submission, error)

func (*Client) FetchUser

func (client *Client) FetchUser(username string) (User, error)

func (*Client) FetchUserComments added in v1.2.0

func (client *Client) FetchUserComments(username string) ([]Comment, error)

func (*Client) FetchUserFavorites added in v1.2.1

func (client *Client) FetchUserFavorites(username string, sort string, page string) ([]Submission, error)

func (*Client) Search

func (client *Client) Search(query string, page string) ([]SearchResult, error)

type Comment

type Comment struct {
	Comments  []Comment
	User      User
	Post      Submission
	Id        string
	Comment   string
	Upvotes   int64
	Downvotes int64
	Platform  string
	CreatedAt string
	RelTime   string
	UpdatedAt string
	DeletedAt string
}

type Media

type Media struct {
	Id          string
	Name        string
	Title       string
	Description string
	Url         string
	Type        string
	MimeType    string
}

type SearchResult

type SearchResult struct {
	Id       string
	Url      string
	ImageUrl string
	Title    string
	User     string
	Points   string
	Views    string
	RelTime  string
}

type Submission

type Submission struct {
	Id        string
	Title     string
	Link      string
	Cover     Media
	Points    int64
	Upvotes   int64
	Downvotes int64
	Comments  int64
	Views     int64
	IsAlbum   bool
}

type Tag

type Tag struct {
	Tag          string
	Display      string
	Sort         string
	PostCount    int64
	Posts        []Submission
	Background   string
	BackgroundId string
}

type User

type User struct {
	Id        int64
	Bio       string
	Username  string
	Points    int64
	Cover     string
	Avatar    string
	CreatedAt string
}

Jump to

Keyboard shortcuts

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