Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotLoggedIn = errors.New("not logged in")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a FurAffinity client.
func (*Client) GetSubmissionDetails ¶
func (c *Client) GetSubmissionDetails(id int64) (*SubmissionDetails, error)
func (*Client) GetUsername ¶
GetUsername makes a request to FA to verify that the provided cookies result in being logged in by finding our username. Returns ErrNotLoggedIn if username could not be found.
type Config ¶
type Config struct { Cookies []Cookie Proxy string // RateLimit is how often requests to furaffinity.net itself are allowed. // Requests to e.g. facdn.net to download images are not affected. RateLimit time.Duration // RequestTimeout is the timeout for a single attempt at the request. RequestTimeout time.Duration RetryDelay time.Duration RetryLimit int // Timeout is the timeout on the entire request, including retries. Timeout time.Duration UserAgent string }
Config is the configuration for the client.
type Submission ¶
type Submission struct { ID int64 PreviewURL string Rating Rating Title string User string // contains filtered or unexported fields }
Submission is an artwork submission.
func (*Submission) Details ¶
func (s *Submission) Details() (*SubmissionDetails, error)
func (*Submission) PreviewImage ¶
func (s *Submission) PreviewImage() ([]byte, error)
func (*Submission) String ¶
func (s *Submission) String() string
type SubmissionDetails ¶
type SubmissionDetails struct { DownloadURL string Description string Stats string // contains filtered or unexported fields }
SubmissionDetails are the details of a specific submission. TODO add more stuff here
func (*SubmissionDetails) Download ¶
func (sd *SubmissionDetails) Download() ([]byte, error)
type SubmissionType ¶
type SubmissionType int
const ( SubmissionTypeGallery SubmissionType = iota SubmissionTypeScraps )
func (SubmissionType) URI ¶
func (st SubmissionType) URI() string
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) GetGallery ¶
func (u *User) GetGallery(st SubmissionType, page uint) ([]*Submission, error)
GetGallery retrieves the specified page of the user's gallery of the specified type. Page numbering starts at 1. NOTE: Rating information is currently not provided on the submissions.
func (*User) GetJournals ¶
GetJournals retrieves the specified page of the user's journal. Page numbering starts at 1.
func (*User) GetRecent ¶
func (u *User) GetRecent() ([]*Submission, []*Journal, error)
GetRecent retrieves the user's most recent submissions and journal. It obtains the data from the user's profile page, so the number of results is limited.
func (*User) GetSubmissions ¶
func (u *User) GetSubmissions(page uint) ([]*Submission, error)
GetSubmissions retrieves the specified page of the user's gallery. Page numbering starts at 1. NOTE: Rating information is currently not provided on the submissions.