fa

package
v0.0.0-...-3b0d830 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FurAffinityUrl

func FurAffinityUrl() *url.URL

Types

type BaseEntry

type BaseEntry interface {
	EntryType() entries.EntryType
	Date() time.Time
	Link() *url.URL
	ID() uint
	From() *FurAffinityUser
	Title() string
	Rating() Rating
}

type CommentContent

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

func (*CommentContent) ID

func (cc *CommentContent) ID() uint

func (*CommentContent) Text

func (cc *CommentContent) Text() string

type CommentEntry

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

func (*CommentEntry) Content

func (ce *CommentEntry) Content() EntryContent

func (*CommentEntry) Date

func (ce *CommentEntry) Date() time.Time

func (*CommentEntry) EntryType

func (ce *CommentEntry) EntryType() entries.EntryType

func (*CommentEntry) From

func (ce *CommentEntry) From() *FurAffinityUser

func (*CommentEntry) HasContent

func (ce *CommentEntry) HasContent() bool

func (*CommentEntry) ID

func (ce *CommentEntry) ID() uint
func (ce *CommentEntry) Link() *url.URL

func (*CommentEntry) Rating

func (ce *CommentEntry) Rating() Rating

func (*CommentEntry) SetContent

func (ce *CommentEntry) SetContent(ec EntryContent)

func (*CommentEntry) Title

func (ce *CommentEntry) Title() string

type Entry

type Entry interface {
	BaseEntry
	Content() EntryContent
	SetContent(EntryContent)
	HasContent() bool
}

type EntryContent

type EntryContent interface {
	ID() uint
	Text() string
}

type EntrySubmissionContent

type EntrySubmissionContent interface {
	ID() uint
	Text() string
	ImageURL() *url.URL
}

type FurAffinityCollector

type FurAffinityCollector struct {
	LimitConcurrency            int
	OnlySinceRegistration       bool
	OnlySinceTypeEnabled        bool
	IterateSubmissionsBackwards bool
	RespectBlockedTags          bool
	User                        *db.User
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector(user *db.User) *FurAffinityCollector

func (*FurAffinityCollector) DateIsValid

func (fc *FurAffinityCollector) DateIsValid(entryType entries.EntryType, date time.Time) bool

DateIsValid returns true if the given date is valid for the user. A date is valid if it is after the user's registration date and if it is after the date at which the entry type was enabled for the user.

func (*FurAffinityCollector) GetNewNotes

func (fc *FurAffinityCollector) GetNewNotes() <-chan *NoteEntry

func (*FurAffinityCollector) GetNewNotesWithContent

func (fc *FurAffinityCollector) GetNewNotesWithContent() <-chan *NoteEntry

func (*FurAffinityCollector) GetNewOtherEntries

func (fc *FurAffinityCollector) GetNewOtherEntries(entryTypes ...entries.EntryType) <-chan Entry

func (*FurAffinityCollector) GetNewOtherEntriesWithContent

func (fc *FurAffinityCollector) GetNewOtherEntriesWithContent(entryTypes ...entries.EntryType) <-chan Entry

func (*FurAffinityCollector) GetNewSubmissionEntries

func (fc *FurAffinityCollector) GetNewSubmissionEntries() <-chan *SubmissionEntry

func (*FurAffinityCollector) GetNewSubmissionEntriesWithContent

func (fc *FurAffinityCollector) GetNewSubmissionEntriesWithContent() <-chan *SubmissionEntry

func (*FurAffinityCollector) GetNoteContent

func (fc *FurAffinityCollector) GetNoteContent(note uint, markUnread bool) *NoteContent

func (*FurAffinityCollector) GetNoteContents

func (fc *FurAffinityCollector) GetNoteContents(notes []uint, markUnread bool) map[uint]*NoteContent

func (*FurAffinityCollector) GetNotes

func (fc *FurAffinityCollector) GetNotes(page uint) <-chan *NoteEntry

func (*FurAffinityCollector) GetOtherEntries

func (fc *FurAffinityCollector) GetOtherEntries(entryTypes ...entries.EntryType) <-chan Entry

func (*FurAffinityCollector) GetOtherEntryContent

func (fc *FurAffinityCollector) GetOtherEntryContent(entry Entry) EntryContent

func (*FurAffinityCollector) GetSubmissionContent

func (fc *FurAffinityCollector) GetSubmissionContent(entry *SubmissionEntry) *SubmissionContent

func (*FurAffinityCollector) GetSubmissionEntries

func (fc *FurAffinityCollector) GetSubmissionEntries() <-chan *SubmissionEntry

func (*FurAffinityCollector) GetSubmissionEntriesWithContent

func (fc *FurAffinityCollector) GetSubmissionEntriesWithContent() <-chan *SubmissionEntry

func (*FurAffinityCollector) IsLoggedIn

func (fc *FurAffinityCollector) IsLoggedIn() (bool, error)

func (*FurAffinityCollector) IsWhitelisted

func (fc *FurAffinityCollector) IsWhitelisted(entryType entries.EntryType, user string) bool

IsWhitelisted returns true if the user is whitelisted for the given entry type or if there is no filter specified for that entry type.

func (*FurAffinityCollector) MarkUnread

func (fc *FurAffinityCollector) MarkUnread(noteId ...uint) error

func (*FurAffinityCollector) OnlyUnreadNotes

func (fc *FurAffinityCollector) OnlyUnreadNotes() bool

func (*FurAffinityCollector) SetUserFilter

func (fc *FurAffinityCollector) SetUserFilter(entryType entries.EntryType, users []string)

func (*FurAffinityCollector) TypeEnabledSince

func (fc *FurAffinityCollector) TypeEnabledSince(entryType entries.EntryType) time.Time

TypeEnabledSince returns the date at which the given entry type was enabled for the user.

func (*FurAffinityCollector) UserID

func (fc *FurAffinityCollector) UserID() uint

type FurAffinityUser

type FurAffinityUser struct {
	DisplayName string
	UserName    string
	ProfileUrl  *url.URL
}

func (FurAffinityUser) IsValid

func (fu FurAffinityUser) IsValid() bool

func (FurAffinityUser) Name

func (fu FurAffinityUser) Name() string

type JournalContent

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

func (*JournalContent) ID

func (jc *JournalContent) ID() uint

func (*JournalContent) Text

func (jc *JournalContent) Text() string

type JournalEntry

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

func (*JournalEntry) Content

func (je *JournalEntry) Content() EntryContent

func (*JournalEntry) Date

func (je *JournalEntry) Date() time.Time

func (*JournalEntry) EntryType

func (je *JournalEntry) EntryType() entries.EntryType

func (*JournalEntry) From

func (je *JournalEntry) From() *FurAffinityUser

func (*JournalEntry) HasContent

func (je *JournalEntry) HasContent() bool

func (*JournalEntry) ID

func (je *JournalEntry) ID() uint
func (je *JournalEntry) Link() *url.URL

func (*JournalEntry) Rating

func (je *JournalEntry) Rating() Rating

func (*JournalEntry) SetContent

func (je *JournalEntry) SetContent(ec EntryContent)

func (*JournalEntry) Title

func (je *JournalEntry) Title() string

type NoteContent

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

func (*NoteContent) ID

func (nc *NoteContent) ID() uint

func (*NoteContent) Text

func (nc *NoteContent) Text() string

type NoteEntry

type NoteEntry struct {
	WasUnread bool
	// contains filtered or unexported fields
}

func (*NoteEntry) Content

func (ne *NoteEntry) Content() EntryContent

func (*NoteEntry) Date

func (ne *NoteEntry) Date() time.Time

func (*NoteEntry) EntryType

func (ne *NoteEntry) EntryType() entries.EntryType

func (*NoteEntry) From

func (ne *NoteEntry) From() *FurAffinityUser

func (*NoteEntry) HasContent

func (ne *NoteEntry) HasContent() bool

func (*NoteEntry) ID

func (ne *NoteEntry) ID() uint
func (ne *NoteEntry) Link() *url.URL

func (*NoteEntry) Rating

func (ne *NoteEntry) Rating() Rating

func (*NoteEntry) SetContent

func (ne *NoteEntry) SetContent(ec EntryContent)

func (*NoteEntry) Title

func (ne *NoteEntry) Title() string

type Rating

type Rating uint8
const (
	RatingGeneral Rating = iota
	RatingMature
	RatingAdult
)

func (Rating) String

func (r Rating) String() string

func (Rating) Symbol

func (r Rating) Symbol() string

func (Rating) SymbolRune

func (r Rating) SymbolRune() rune

type SubmissionContent

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

type SubmissionData

type SubmissionData struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Username    string `json:"username"`
	Lower       string `json:"lower"`
	AvatarMTime uint   `json:"avatar_mtime,string"`
}

type SubmissionDataMap

type SubmissionDataMap map[uint]*SubmissionData

type SubmissionEntry

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

func (*SubmissionEntry) BlockedReasons

func (se *SubmissionEntry) BlockedReasons() dsext.Set[string]

func (*SubmissionEntry) Content

func (se *SubmissionEntry) Content() *SubmissionContent

func (*SubmissionEntry) Date

func (se *SubmissionEntry) Date() time.Time

Date returns the creation date of the submission. If no content is available, this is not the exact time but the time acquired from the whole block of the submission page.

func (*SubmissionEntry) Description

func (se *SubmissionEntry) Description() string

func (*SubmissionEntry) EntryType

func (se *SubmissionEntry) EntryType() entries.EntryType

func (*SubmissionEntry) From

func (se *SubmissionEntry) From() *FurAffinityUser

func (*SubmissionEntry) FullView

func (se *SubmissionEntry) FullView() *url.URL

func (*SubmissionEntry) HasContent

func (se *SubmissionEntry) HasContent() bool

func (*SubmissionEntry) ID

func (se *SubmissionEntry) ID() uint

func (*SubmissionEntry) IsBlocked

func (se *SubmissionEntry) IsBlocked() bool
func (se *SubmissionEntry) Link() *url.URL

func (*SubmissionEntry) Rating

func (se *SubmissionEntry) Rating() Rating

func (*SubmissionEntry) SetContent

func (se *SubmissionEntry) SetContent(content *SubmissionContent)

func (*SubmissionEntry) SubmissionData

func (se *SubmissionEntry) SubmissionData() *SubmissionData

func (*SubmissionEntry) Tags

func (se *SubmissionEntry) Tags() dsext.Set[string]

func (*SubmissionEntry) Thumbnail

func (se *SubmissionEntry) Thumbnail() *tools.ThumbnailUrl

func (*SubmissionEntry) Title

func (se *SubmissionEntry) Title() string

func (*SubmissionEntry) Type

func (se *SubmissionEntry) Type() SubmissionType

type SubmissionType

type SubmissionType uint8
const (
	SubmissionTypeUnknown SubmissionType = iota
	SubmissionTypeImage
	SubmissionTypeText
)

func (SubmissionType) String

func (st SubmissionType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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