Documentation ¶
Index ¶
- Constants
- Variables
- func AddAction() *api.Action
- func AgeInYears(birthDayString string) int
- func AllKitsuAnime() []*kitsu.Anime
- func AniListAnimeListStatus(item *anilist.AnimeListItem) string
- func AnimeRatingStars(rating float64) string
- func AuthorizeIfLoggedIn(ctx aero.Context) error
- func AuthorizeIfLoggedInAndOwnData(ctx aero.Context, userIDParameterName string) error
- func BroadcastEvent(event *aero.Event)
- func Contains(collection []string, t string) bool
- func CreateDifferenceID(animeID string, dataProvider string, malAnimeID string, typeName string) string
- func DateTimeUTC() string
- func DateToSeason(date time.Time) string
- func EpisodeCountMax(episodes int) string
- func EpisodesToString(episodes int) string
- func FilterIDTags(tags []string, idType string) []string
- func FilterKitsuAnime(filter func(*kitsu.Anime) bool) []*kitsu.Anime
- func FilterKitsuMappings(filter func(*kitsu.Mapping) bool) []*kitsu.Mapping
- func FindFileWithExtension(baseName string, dir string, extensions []string) string
- func FixAnimeDescription(description string) string
- func FixGender(gender string) string
- func GenerateID(collection string) string
- func GetCompanyToAnimeMap() map[string][]*Anime
- func GetForumIcon(category string) string
- func GetGenreIDByName(genre string) string
- func GetGenreIcon(genre string) string
- func GetObjectLink(typeName string, id string) string
- func GetObjectTitle(typeName string, id string) string
- func HostName() string
- func HumanReadableAnimeRelation(relationName string) string
- func IndexOf(collection []string, t string) int
- func IsAnimeDifferenceIgnored(animeID string, dataProvider string, malAnimeID string, typeName string, ...) bool
- func IsDevelopment() bool
- func IsIPv6(ip string) bool
- func IsLocked(obj interface{}) bool
- func IsProduction() bool
- func IsTest() bool
- func JSON(obj interface{}) string
- func JoinAction() *api.Action
- func KitsuStatusToARNStatus(status string) string
- func LeaveAction() *api.Action
- func LikeAction() *api.Action
- func ListItemStatusName(status string) string
- func LoadImage(path string) (img image.Image, format string, err error)
- func LockAction() *api.Action
- func MyAnimeListStatusToARNStatus(status int) string
- func NewAnimeFromKitsuAnime(kitsuAnime *kitsu.Anime) (*Anime, *AnimeCharacters, *AnimeRelations, *AnimeEpisodes)
- func OverallRatingName(episodes int) string
- func PanicOnError(err error)
- func PayPal() (*paypalsdk.Client, error)
- func PublishAction() *api.Action
- func RGBToHSL(r, g, b float64) (h, s, l float64)
- func RegisterUser(user *User)
- func RemoveAction() *api.Action
- func SetObjectProperties(rootObj interface{}, updates map[string]interface{}) error
- func SortActivitiesLatestFirst(entries []Activity)
- func SortAnimeByPopularity(animes []*Anime)
- func SortAnimeByQuality(animes []*Anime)
- func SortAnimeByQualityDetailed(animes []*Anime, filterStatus string)
- func SortCharactersByLikes(characters []*Character)
- func SortCompaniesPopularFirst(companies []*Company)
- func SortEditLogEntriesLatestFirst(entries []*EditLogEntry)
- func SortPersonsByLikes(persons []*Person)
- func SortPostablesLatestFirst(posts []Postable)
- func SortPostsLatestFirst(posts []*Post)
- func SortPostsLatestLast(posts []*Post)
- func SortQuotesLatestFirst(quotes []*Quote)
- func SortQuotesPopularFirst(quotes []*Quote)
- func SortSoundTracksLatestFirst(tracks []*SoundTrack)
- func SortSoundTracksPopularFirst(tracks []*SoundTrack)
- func SortThreads(threads []*Thread)
- func SortThreadsLatestFirst(threads []*Thread)
- func SortUsersFollowers(users []*User)
- func SortUsersLastSeenFirst(users []*User)
- func SortUsersLastSeenLast(users []*User)
- func StreamAMVs() <-chan *AMV
- func StreamActivities() <-chan Activity
- func StreamActivityCreates() <-chan *ActivityCreate
- func StreamAnalytics() <-chan *Analytics
- func StreamAnime() <-chan *Anime
- func StreamAnimeCharacters() <-chan *AnimeCharacters
- func StreamAnimeEpisodes() <-chan *AnimeEpisodes
- func StreamAnimeLists() <-chan *AnimeList
- func StreamAnimeRelations() <-chan *AnimeRelations
- func StreamCharacters() <-chan *Character
- func StreamClientErrorReports() <-chan *ClientErrorReport
- func StreamCompanies() <-chan *Company
- func StreamEditLogEntries() <-chan *EditLogEntry
- func StreamGroups() <-chan *Group
- func StreamIgnoreAnimeDifferences() <-chan *IgnoreAnimeDifference
- func StreamKitsuAnime() <-chan *kitsu.Anime
- func StreamKitsuMappings() <-chan *kitsu.Mapping
- func StreamNotifications() <-chan *Notification
- func StreamPayPalPayments() <-chan *PayPalPayment
- func StreamPersons() <-chan *Person
- func StreamPosts() <-chan *Post
- func StreamPurchases() <-chan *Purchase
- func StreamQuotes() <-chan *Quote
- func StreamShopItems() <-chan *ShopItem
- func StreamSoundTracks() <-chan *SoundTrack
- func StreamThreads() <-chan *Thread
- func StreamUserFollows() <-chan *UserFollows
- func StreamUserNotifications() <-chan *UserNotifications
- func StreamUsers() <-chan *User
- func UnlikeAction() *api.Action
- func UnlockAction() *api.Action
- func UnpublishAction() *api.Action
- func UserFollowerCountMap() map[string]int
- type AMV
- func (obj *AMV) AddPost(postID string)
- func (amv *AMV) Authorize(ctx aero.Context, action string) error
- func (obj *AMV) CountLikes() int
- func (obj *AMV) CountPosts() int
- func (amv *AMV) Create(ctx aero.Context) error
- func (obj *AMV) Creator() *User
- func (obj *AMV) CreatorID() UserID
- func (amv *AMV) Delete() error
- func (amv *AMV) DeleteInContext(ctx aero.Context) error
- func (amv *AMV) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
- func (obj *AMV) Editor() *User
- func (amv *AMV) ExtraAnime() []*Anime
- func (obj *AMV) GetCreated() string
- func (obj *AMV) GetCreatedBy() UserID
- func (obj *AMV) GetCreatedTime() time.Time
- func (obj *AMV) GetID() string
- func (obj *AMV) GetIsDraft() bool
- func (obj *AMV) Like(userID UserID)
- func (obj *AMV) LikedBy(userID UserID) bool
- func (amv *AMV) Link() string
- func (amv *AMV) MainAnime() *Anime
- func (amv *AMV) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (amv *AMV) OnLike(likedBy *User)
- func (amv *AMV) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (obj *AMV) Posts() []*Post
- func (obj *AMV) PostsRelevantFirst(count int) []*Post
- func (amv *AMV) Publish() error
- func (amv *AMV) RefreshInfo() error
- func (obj *AMV) RemovePost(postID string) bool
- func (amv *AMV) Save()
- func (amv *AMV) Self() Loggable
- func (obj *AMV) SetIsDraft(isDraft bool)
- func (amv *AMV) SetVideoBytes(data []byte) error
- func (amv *AMV) String() string
- func (amv *AMV) TitleByUser(user *User) string
- func (amv *AMV) TypeName() string
- func (obj *AMV) Unlike(userID UserID)
- func (amv *AMV) Unpublish() error
- func (amv *AMV) VideoEditors() []*User
- type AMVTitle
- type APIKeysData
- type Activity
- type ActivityConsumeAnime
- func (activity *ActivityConsumeAnime) Anime() *Anime
- func (activity *ActivityConsumeAnime) Authorize(ctx aero.Context, action string) error
- func (obj *ActivityConsumeAnime) CountLikes() int
- func (obj *ActivityConsumeAnime) Creator() *User
- func (obj *ActivityConsumeAnime) CreatorID() UserID
- func (activity *ActivityConsumeAnime) Delete() error
- func (activity *ActivityConsumeAnime) DeleteInContext(ctx aero.Context) error
- func (obj *ActivityConsumeAnime) GetCreated() string
- func (obj *ActivityConsumeAnime) GetCreatedBy() UserID
- func (obj *ActivityConsumeAnime) GetCreatedTime() time.Time
- func (obj *ActivityConsumeAnime) GetID() string
- func (obj *ActivityConsumeAnime) Like(userID UserID)
- func (obj *ActivityConsumeAnime) LikedBy(userID UserID) bool
- func (activity *ActivityConsumeAnime) Save()
- func (activity *ActivityConsumeAnime) Self() Loggable
- func (activity *ActivityConsumeAnime) TypeName() string
- func (obj *ActivityConsumeAnime) Unlike(userID UserID)
- type ActivityCreate
- func (obj *ActivityCreate) Creator() *User
- func (obj *ActivityCreate) CreatorID() UserID
- func (activity *ActivityCreate) Delete() error
- func (obj *ActivityCreate) GetCreated() string
- func (obj *ActivityCreate) GetCreatedBy() UserID
- func (obj *ActivityCreate) GetCreatedTime() time.Time
- func (obj *ActivityCreate) GetID() string
- func (activity *ActivityCreate) Object() Likeable
- func (activity *ActivityCreate) Postable() Postable
- func (activity *ActivityCreate) Save()
- func (activity *ActivityCreate) Self() Loggable
- func (activity *ActivityCreate) TypeName() string
- type AiringDate
- type Analytics
- type AnalyticsItem
- type AniListAnimeFinder
- type AniListMatch
- type Anime
- func (anime *Anime) AddLicensor(companyID string)
- func (obj *Anime) AddPost(postID string)
- func (anime *Anime) AddProducer(companyID string)
- func (anime *Anime) AddStudio(companyID string)
- func (anime *Anime) Authorize(ctx aero.Context, action string) error
- func (anime *Anime) AverageColor() string
- func (anime *Anime) CalculatedStatus() string
- func (anime *Anime) Characters() *AnimeCharacters
- func (obj *Anime) CountLikes() int
- func (obj *Anime) CountPosts() int
- func (obj *Anime) Creator() *User
- func (obj *Anime) CreatorID() UserID
- func (anime *Anime) Delete() error
- func (anime *Anime) DeleteInContext(ctx aero.Context) error
- func (anime *Anime) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
- func (obj *Anime) Editor() *User
- func (anime *Anime) EndDateTime() time.Time
- func (anime *Anime) EpisodeByNumber(number int) *AnimeEpisode
- func (anime *Anime) EpisodeCountString() string
- func (anime *Anime) Episodes() *AnimeEpisodes
- func (obj *Anime) GetCreated() string
- func (obj *Anime) GetCreatedBy() UserID
- func (obj *Anime) GetCreatedTime() time.Time
- func (obj *Anime) GetID() string
- func (obj *Anime) GetIsDraft() bool
- func (obj *Anime) GetMapping(name string) string
- func (anime *Anime) HasImage() bool
- func (anime *Anime) ImageLink(size string) string
- func (anime *Anime) ImportKitsuMapping(mapping *kitsu.Mapping)
- func (anime *Anime) Licensors() []*Company
- func (obj *Anime) Like(userID UserID)
- func (obj *Anime) LikedBy(userID UserID) bool
- func (anime *Anime) Link() string
- func (anime *Anime) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (anime *Anime) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (obj *Anime) Posts() []*Post
- func (obj *Anime) PostsRelevantFirst(count int) []*Post
- func (anime *Anime) Prequels() []*Anime
- func (anime *Anime) Producers() []*Company
- func (anime *Anime) RefreshAnimeCharacters() (*AnimeCharacters, error)
- func (anime *Anime) RefreshEpisodes() error
- func (anime *Anime) Relations() *AnimeRelations
- func (obj *Anime) RemoveMapping(name string) bool
- func (obj *Anime) RemovePost(postID string) bool
- func (anime *Anime) Save()
- func (anime *Anime) Score() float64
- func (anime *Anime) ScoreHumanReadable() string
- func (anime *Anime) Season() string
- func (anime *Anime) Self() Loggable
- func (anime *Anime) SetImage(metaImage *imageserver.MetaImage) error
- func (anime *Anime) SetImageBytes(data []byte) error
- func (obj *Anime) SetIsDraft(isDraft bool)
- func (obj *Anime) SetMapping(serviceName string, serviceID string)
- func (anime *Anime) ShoboiEpisodes() ([]*AnimeEpisode, error)
- func (anime *Anime) StartDateTime() time.Time
- func (anime *Anime) StatusHumanReadable() string
- func (anime *Anime) String() string
- func (anime *Anime) Studios() []*Company
- func (anime *Anime) TitleByUser(user *User) string
- func (anime *Anime) TwistEpisodes() ([]*AnimeEpisode, error)
- func (anime *Anime) TypeHumanReadable() string
- func (anime *Anime) TypeName() string
- func (obj *Anime) Unlike(userID UserID)
- func (anime *Anime) UpcomingEpisode() *UpcomingEpisode
- func (anime *Anime) UpcomingEpisodes() []*UpcomingEpisode
- func (anime *Anime) UsersWatchingOrPlanned() []*User
- type AnimeCharacter
- type AnimeCharacters
- func (characters *AnimeCharacters) Add(animeCharacter *AnimeCharacter) error
- func (characters *AnimeCharacters) Anime() *Anime
- func (characters *AnimeCharacters) Authorize(ctx aero.Context, action string) error
- func (characters *AnimeCharacters) Contains(characterID string) bool
- func (characters *AnimeCharacters) Delete() error
- func (characters *AnimeCharacters) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
- func (characters *AnimeCharacters) FindByMapping(service string, serviceID string) *AnimeCharacter
- func (characters *AnimeCharacters) First(count int) []*AnimeCharacter
- func (characters *AnimeCharacters) GetID() string
- func (characters *AnimeCharacters) Link() string
- func (characters *AnimeCharacters) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (characters *AnimeCharacters) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (characters *AnimeCharacters) Save()
- func (characters *AnimeCharacters) Self() Loggable
- func (characters *AnimeCharacters) String() string
- func (characters *AnimeCharacters) TypeName() string
- type AnimeEpisode
- type AnimeEpisodes
- func (episodes *AnimeEpisodes) Anime() *Anime
- func (episodes *AnimeEpisodes) Authorize(ctx aero.Context, action string) error
- func (episodes *AnimeEpisodes) AvailableCount() int
- func (episodes *AnimeEpisodes) Delete() error
- func (episodes *AnimeEpisodes) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
- func (episodes *AnimeEpisodes) Find(episodeNumber int) (*AnimeEpisode, int)
- func (episodes *AnimeEpisodes) GetID() string
- func (episodes *AnimeEpisodes) Last(count int) []*AnimeEpisode
- func (episodes *AnimeEpisodes) Link() string
- func (episodes *AnimeEpisodes) ListString() string
- func (episodes *AnimeEpisodes) Merge(b []*AnimeEpisode)
- func (episodes *AnimeEpisodes) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (episodes *AnimeEpisodes) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (episodes *AnimeEpisodes) Save()
- func (episodes *AnimeEpisodes) Self() Loggable
- func (episodes *AnimeEpisodes) Sort()
- func (episodes *AnimeEpisodes) String() string
- func (episodes *AnimeEpisodes) TypeName() string
- type AnimeFinder
- type AnimeImage
- type AnimeList
- func (list *AnimeList) Add(animeID string) error
- func (list *AnimeList) Authorize(ctx aero.Context, action string) error
- func (list *AnimeList) Contains(animeID string) bool
- func (list *AnimeList) FilterStatus(status string) *AnimeList
- func (list *AnimeList) Find(animeID string) *AnimeListItem
- func (list *AnimeList) Genres() map[string][]*AnimeListItem
- func (list *AnimeList) GetID() string
- func (list *AnimeList) HasItemsWithStatus(status string) bool
- func (list *AnimeList) Import(item *AnimeListItem)
- func (list *AnimeList) NormalizeRatings()
- func (list *AnimeList) Remove(animeID string) bool
- func (list *AnimeList) RemoveDuplicates()
- func (list *AnimeList) Save()
- func (list *AnimeList) Self() Loggable
- func (list *AnimeList) Sort()
- func (list *AnimeList) SortByRating()
- func (list *AnimeList) SplitByStatus() map[string]*AnimeList
- func (list *AnimeList) Top(count int) []*AnimeListItem
- func (list *AnimeList) TopGenres(count int) []string
- func (list *AnimeList) TypeName() string
- func (list *AnimeList) User() *User
- func (list *AnimeList) Watching() *AnimeList
- func (list *AnimeList) WithoutPrivateItems() *AnimeList
- type AnimeListItem
- func (item *AnimeListItem) AfterEdit(ctx aero.Context) error
- func (item *AnimeListItem) Anime() *Anime
- func (item *AnimeListItem) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
- func (item *AnimeListItem) Link(userNick string) string
- func (item *AnimeListItem) OnEpisodesChange()
- func (item *AnimeListItem) OnStatusChange()
- func (item *AnimeListItem) StatusHumanReadable() string
- type AnimeListItemRating
- type AnimePopularity
- type AnimeRating
- type AnimeRatingCount
- type AnimeRelation
- type AnimeRelations
- func (relations *AnimeRelations) Anime() *Anime
- func (relations *AnimeRelations) Authorize(ctx aero.Context, action string) error
- func (relations *AnimeRelations) Delete() error
- func (relations *AnimeRelations) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
- func (relations *AnimeRelations) Find(animeID string) *AnimeRelation
- func (relations *AnimeRelations) GetID() string
- func (relations *AnimeRelations) Link() string
- func (relations *AnimeRelations) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (relations *AnimeRelations) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (relations *AnimeRelations) Remove(animeID string) bool
- func (relations *AnimeRelations) Save()
- func (relations *AnimeRelations) Self() Loggable
- func (relations *AnimeRelations) SortByStartDate()
- func (relations *AnimeRelations) String() string
- func (relations *AnimeRelations) TypeName() string
- type AnimeTitle
- type AvatarSettings
- type CSSPosition
- type CalendarSettings
- type Character
- func (obj *Character) AddPost(postID string)
- func (character *Character) Anime() []*Anime
- func (character *Character) Authorize(ctx aero.Context, action string) error
- func (character *Character) AverageColor() string
- func (obj *Character) CountLikes() int
- func (obj *Character) CountPosts() int
- func (character *Character) Create(ctx aero.Context) error
- func (obj *Character) Creator() *User
- func (obj *Character) CreatorID() UserID
- func (character *Character) Delete() error
- func (character *Character) DeleteImages()
- func (character *Character) DeleteInContext(ctx aero.Context) error
- func (character *Character) DownloadImage(url string) error
- func (character *Character) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
- func (obj *Character) Editor() *User
- func (obj *Character) GetCreated() string
- func (obj *Character) GetCreatedBy() UserID
- func (obj *Character) GetCreatedTime() time.Time
- func (obj *Character) GetID() string
- func (obj *Character) GetIsDraft() bool
- func (obj *Character) GetMapping(name string) string
- func (character *Character) HasImage() bool
- func (character *Character) ImageLink(size string) string
- func (obj *Character) Like(userID UserID)
- func (obj *Character) LikedBy(userID UserID) bool
- func (character *Character) Link() string
- func (character *Character) MainQuote() *Quote
- func (character *Character) Merge(target *Character)
- func (character *Character) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (character *Character) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (obj *Character) Posts() []*Post
- func (obj *Character) PostsRelevantFirst(count int) []*Post
- func (character *Character) Publish() error
- func (character *Character) Quotes() []*Quote
- func (obj *Character) RemoveMapping(name string) bool
- func (obj *Character) RemovePost(postID string) bool
- func (character *Character) Save()
- func (character *Character) Self() Loggable
- func (character *Character) SetImage(metaImage *imageserver.MetaImage) error
- func (character *Character) SetImageBytes(data []byte) error
- func (obj *Character) SetIsDraft(isDraft bool)
- func (obj *Character) SetMapping(serviceName string, serviceID string)
- func (character *Character) String() string
- func (character *Character) TitleByUser(user *User) string
- func (character *Character) TypeName() string
- func (obj *Character) Unlike(userID UserID)
- func (character *Character) Unpublish() error
- type CharacterAttribute
- type CharacterFinder
- type CharacterImage
- type CharacterName
- type ClientErrorReport
- func (report *ClientErrorReport) Authorize(ctx aero.Context, action string) error
- func (report *ClientErrorReport) Create(ctx aero.Context) error
- func (obj *ClientErrorReport) Creator() *User
- func (obj *ClientErrorReport) CreatorID() UserID
- func (obj *ClientErrorReport) GetCreated() string
- func (obj *ClientErrorReport) GetCreatedBy() UserID
- func (obj *ClientErrorReport) GetCreatedTime() time.Time
- func (report *ClientErrorReport) Save()
- type Company
- func (company *Company) Anime() (studioAnime []*Anime, producedAnime []*Anime, licensedAnime []*Anime)
- func (company *Company) Authorize(ctx aero.Context, action string) error
- func (obj *Company) CountLikes() int
- func (company *Company) Create(ctx aero.Context) error
- func (obj *Company) Creator() *User
- func (obj *Company) CreatorID() UserID
- func (company *Company) Delete() error
- func (company *Company) DeleteInContext(ctx aero.Context) error
- func (company *Company) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
- func (obj *Company) Editor() *User
- func (obj *Company) GetCreated() string
- func (obj *Company) GetCreatedBy() UserID
- func (obj *Company) GetCreatedTime() time.Time
- func (obj *Company) GetID() string
- func (obj *Company) GetIsDraft() bool
- func (obj *Company) GetMapping(name string) string
- func (obj *Company) Like(userID UserID)
- func (obj *Company) LikedBy(userID UserID) bool
- func (company *Company) Link() string
- func (company *Company) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (company *Company) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (company *Company) Publish() error
- func (obj *Company) RemoveMapping(name string) bool
- func (company *Company) Save()
- func (company *Company) Self() Loggable
- func (obj *Company) SetIsDraft(isDraft bool)
- func (obj *Company) SetMapping(serviceName string, serviceID string)
- func (company *Company) String() string
- func (company *Company) TypeName() string
- func (obj *Company) Unlike(userID UserID)
- func (company *Company) Unpublish() error
- type CompanyName
- type ConnectionAnalytics
- type DraftIndex
- type Draftable
- type EditLogEntry
- type EditorFilterSettings
- type EditorSettings
- type EmailToUser
- type EpisodeTitle
- type ExternalMedia
- type FacebookToUser
- type FormatSettings
- type GeneralAnalytics
- type GoogleToUser
- type Group
- func (obj *Group) AddPost(postID string)
- func (group *Group) Authorize(ctx aero.Context, action string) error
- func (group *Group) AverageColor() string
- func (obj *Group) CountPosts() int
- func (group *Group) Create(ctx aero.Context) error
- func (obj *Group) Creator() *User
- func (obj *Group) CreatorID() UserID
- func (group *Group) Delete() error
- func (group *Group) DeleteImages()
- func (group *Group) DeleteInContext(ctx aero.Context) error
- func (group *Group) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
- func (obj *Group) Editor() *User
- func (group *Group) FindMember(userID UserID) *GroupMember
- func (obj *Group) GetCreated() string
- func (obj *Group) GetCreatedBy() UserID
- func (obj *Group) GetCreatedTime() time.Time
- func (obj *Group) GetID() string
- func (obj *Group) GetIsDraft() bool
- func (group *Group) HasImage() bool
- func (group *Group) HasMember(userID UserID) bool
- func (group *Group) ImageLink(size string) string
- func (group *Group) Join(user *User) error
- func (group *Group) Leave(user *User) error
- func (group *Group) Link() string
- func (group *Group) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (group *Group) OnJoin(user *User)
- func (group *Group) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (obj *Group) Posts() []*Post
- func (obj *Group) PostsRelevantFirst(count int) []*Post
- func (group *Group) Publish() error
- func (obj *Group) RemovePost(postID string) bool
- func (group *Group) Save()
- func (group *Group) Self() Loggable
- func (group *Group) SendNotification(notification *PushNotification, excludeUserID UserID)
- func (group *Group) SetImage(metaImage *imageserver.MetaImage) error
- func (group *Group) SetImageBytes(data []byte) error
- func (obj *Group) SetIsDraft(isDraft bool)
- func (group *Group) String() string
- func (group *Group) TitleByUser(user *User) string
- func (group *Group) TypeName() string
- func (group *Group) Unpublish() error
- func (group *Group) Users() []*User
- type GroupImage
- type GroupMember
- type HSLColor
- type IDCollection
- type IDList
- type IPInfoDBLocation
- type IgnoreAnimeDifference
- func (ignore *IgnoreAnimeDifference) Authorize(ctx aero.Context, action string) error
- func (ignore *IgnoreAnimeDifference) Create(ctx aero.Context) error
- func (obj *IgnoreAnimeDifference) Creator() *User
- func (obj *IgnoreAnimeDifference) CreatorID() UserID
- func (obj *IgnoreAnimeDifference) GetCreated() string
- func (obj *IgnoreAnimeDifference) GetCreatedBy() UserID
- func (obj *IgnoreAnimeDifference) GetCreatedTime() time.Time
- func (ignore *IgnoreAnimeDifference) Save()
- type Inventory
- type InventorySlot
- type Joinable
- type KitsuMatch
- type LikeEventReceiver
- type Likeable
- type Link
- type Linkable
- type ListProviderConfig
- type Location
- type LockEventReceiver
- type Lockable
- type Loggable
- type Mapping
- type MyAnimeListMatch
- type Name
- type NickToUser
- type Notification
- type NotificationSettings
- type OpenGraph
- type Option
- type PayPalPayment
- type Person
- func (obj *Person) AddPost(postID string)
- func (person *Person) Authorize(ctx aero.Context, action string) error
- func (obj *Person) CountLikes() int
- func (obj *Person) CountPosts() int
- func (person *Person) Create(ctx aero.Context) error
- func (obj *Person) Creator() *User
- func (obj *Person) CreatorID() UserID
- func (person *Person) Delete() error
- func (person *Person) DeleteImages()
- func (person *Person) DeleteInContext(ctx aero.Context) error
- func (person *Person) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
- func (obj *Person) Editor() *User
- func (obj *Person) GetCreated() string
- func (obj *Person) GetCreatedBy() UserID
- func (obj *Person) GetCreatedTime() time.Time
- func (obj *Person) GetID() string
- func (obj *Person) GetIsDraft() bool
- func (person *Person) HasImage() bool
- func (person *Person) ImageLink(size string) string
- func (obj *Person) Like(userID UserID)
- func (obj *Person) LikedBy(userID UserID) bool
- func (person *Person) Link() string
- func (person *Person) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (person *Person) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (obj *Person) Posts() []*Post
- func (obj *Person) PostsRelevantFirst(count int) []*Post
- func (person *Person) Publish() error
- func (obj *Person) RemovePost(postID string) bool
- func (person *Person) Save()
- func (person *Person) Self() Loggable
- func (obj *Person) SetIsDraft(isDraft bool)
- func (person *Person) String() string
- func (person *Person) TitleByUser(user *User) string
- func (person *Person) TypeName() string
- func (obj *Person) Unlike(userID UserID)
- func (person *Person) Unpublish() error
- type PersonImage
- type PersonName
- type PieChart
- type PieChartSlice
- type Post
- func (obj *Post) AddPost(postID string)
- func (post *Post) AfterEdit(ctx aero.Context) error
- func (post *Post) Authorize(ctx aero.Context, action string) error
- func (obj *Post) CountLikes() int
- func (obj *Post) CountPosts() int
- func (post *Post) Create(ctx aero.Context) error
- func (obj *Post) Creator() *User
- func (obj *Post) CreatorID() UserID
- func (post *Post) Delete() error
- func (post *Post) DeleteInContext(ctx aero.Context) error
- func (post *Post) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
- func (obj *Post) GetCreated() string
- func (obj *Post) GetCreatedBy() UserID
- func (obj *Post) GetCreatedTime() time.Time
- func (obj *Post) GetID() string
- func (post *Post) GetParentID() string
- func (obj *Post) GetText() string
- func (post *Post) HTML() string
- func (obj *Post) Like(userID UserID)
- func (obj *Post) LikedBy(userID UserID) bool
- func (post *Post) Link() string
- func (post *Post) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (post *Post) OnLike(likedBy *User)
- func (post *Post) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (post *Post) Parent() PostParent
- func (obj *Post) Posts() []*Post
- func (obj *Post) PostsRelevantFirst(count int) []*Post
- func (obj *Post) RemovePost(postID string) bool
- func (post *Post) Save()
- func (post *Post) Self() Loggable
- func (post *Post) SetParent(newParent PostParent)
- func (post *Post) String() string
- func (post *Post) TitleByUser(user *User) string
- func (post *Post) TopMostParent() PostParent
- func (post *Post) TypeName() string
- func (obj *Post) Unlike(userID UserID)
- type PostParent
- type Postable
- type PrivacySettings
- type Publishable
- type Purchase
- type PushEndpoint
- type PushNotification
- type PushSubscription
- type PushSubscriptions
- func (list *PushSubscriptions) Add(subscription *PushSubscription) error
- func (list *PushSubscriptions) Authorize(ctx aero.Context, action string) error
- func (list *PushSubscriptions) Contains(subscriptionID string) bool
- func (list *PushSubscriptions) Filter()
- func (list *PushSubscriptions) Find(id string) *PushSubscription
- func (list *PushSubscriptions) Remove(subscriptionID string) bool
- func (list *PushSubscriptions) Save()
- func (list *PushSubscriptions) ShouldFilter(ctx aero.Context) bool
- type Quote
- func (obj *Quote) AddPost(postID string)
- func (quote *Quote) Anime() *Anime
- func (quote *Quote) Authorize(ctx aero.Context, action string) error
- func (quote *Quote) Character() *Character
- func (obj *Quote) CountLikes() int
- func (obj *Quote) CountPosts() int
- func (quote *Quote) Create(ctx aero.Context) error
- func (obj *Quote) Creator() *User
- func (obj *Quote) CreatorID() UserID
- func (quote *Quote) Delete() error
- func (quote *Quote) DeleteInContext(ctx aero.Context) error
- func (quote *Quote) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
- func (obj *Quote) Editor() *User
- func (obj *Quote) GetCreated() string
- func (obj *Quote) GetCreatedBy() UserID
- func (obj *Quote) GetCreatedTime() time.Time
- func (obj *Quote) GetID() string
- func (obj *Quote) GetIsDraft() bool
- func (quote *Quote) IsMainQuote() bool
- func (quote *Quote) IsValid() bool
- func (obj *Quote) Like(userID UserID)
- func (obj *Quote) LikedBy(userID UserID) bool
- func (quote *Quote) Link() string
- func (quote *Quote) OnLike(likedBy *User)
- func (obj *Quote) Posts() []*Post
- func (obj *Quote) PostsRelevantFirst(count int) []*Post
- func (quote *Quote) Publish() error
- func (obj *Quote) RemovePost(postID string) bool
- func (quote *Quote) Save()
- func (quote *Quote) Self() Loggable
- func (obj *Quote) SetIsDraft(isDraft bool)
- func (quote *Quote) String() string
- func (quote *Quote) TitleByUser(user *User) string
- func (quote *Quote) TypeName() string
- func (obj *Quote) Unlike(userID UserID)
- func (quote *Quote) Unpublish() error
- type QuoteText
- type ScreenAnalytics
- type ServiceProviders
- type Session
- type Settings
- func (settings *Settings) Authorize(ctx aero.Context, action string) error
- func (settings *Settings) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
- func (settings *Settings) Filter()
- func (settings *Settings) Save()
- func (settings *Settings) ShouldFilter(ctx aero.Context) bool
- func (settings *Settings) User() *User
- type ShopItem
- type SoundTrack
- func (obj *SoundTrack) AddPost(postID string)
- func (track *SoundTrack) Anime() []*Anime
- func (track *SoundTrack) Authorize(ctx aero.Context, action string) error
- func (obj *SoundTrack) CountLikes() int
- func (obj *SoundTrack) CountPosts() int
- func (track *SoundTrack) Create(ctx aero.Context) error
- func (obj *SoundTrack) Creator() *User
- func (obj *SoundTrack) CreatorID() UserID
- func (track *SoundTrack) Delete() error
- func (track *SoundTrack) DeleteInContext(ctx aero.Context) error
- func (track *SoundTrack) Download() error
- func (track *SoundTrack) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
- func (track *SoundTrack) EditedByUser() *User
- func (obj *SoundTrack) Editor() *User
- func (track *SoundTrack) EtternaBeatmaps() []string
- func (obj *SoundTrack) GetCreated() string
- func (obj *SoundTrack) GetCreatedBy() UserID
- func (obj *SoundTrack) GetCreatedTime() time.Time
- func (obj *SoundTrack) GetID() string
- func (obj *SoundTrack) GetIsDraft() bool
- func (track *SoundTrack) HasLyrics() bool
- func (track *SoundTrack) HasMediaByService(service string) bool
- func (track *SoundTrack) HasTag(search string) bool
- func (obj *SoundTrack) Like(userID UserID)
- func (obj *SoundTrack) LikedBy(userID UserID) bool
- func (track *SoundTrack) Link() string
- func (track *SoundTrack) MainAnime() *Anime
- func (track *SoundTrack) MediaByService(service string) []*ExternalMedia
- func (track *SoundTrack) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (track *SoundTrack) OnLike(likedBy *User)
- func (track *SoundTrack) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (track *SoundTrack) OsuBeatmaps() []string
- func (obj *SoundTrack) Posts() []*Post
- func (obj *SoundTrack) PostsRelevantFirst(count int) []*Post
- func (track *SoundTrack) Publish() error
- func (obj *SoundTrack) RemovePost(postID string) bool
- func (track *SoundTrack) Save()
- func (track *SoundTrack) Self() Loggable
- func (obj *SoundTrack) SetIsDraft(isDraft bool)
- func (track *SoundTrack) String() string
- func (track *SoundTrack) TitleByUser(user *User) string
- func (track *SoundTrack) TypeName() string
- func (obj *SoundTrack) Unlike(userID UserID)
- func (track *SoundTrack) Unpublish() error
- type SoundTrackLyrics
- type SoundTrackTitle
- type Spoiler
- type StatisticsCategory
- type SystemAnalytics
- type Thread
- func (obj *Thread) AddPost(postID string)
- func (thread *Thread) AfterEdit(ctx aero.Context) error
- func (thread *Thread) Authorize(ctx aero.Context, action string) error
- func (obj *Thread) CountLikes() int
- func (obj *Thread) CountPosts() int
- func (thread *Thread) Create(ctx aero.Context) error
- func (obj *Thread) Creator() *User
- func (obj *Thread) CreatorID() UserID
- func (thread *Thread) Delete() error
- func (thread *Thread) DeleteInContext(ctx aero.Context) error
- func (thread *Thread) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
- func (obj *Thread) GetCreated() string
- func (obj *Thread) GetCreatedBy() UserID
- func (obj *Thread) GetCreatedTime() time.Time
- func (obj *Thread) GetID() string
- func (thread *Thread) GetParentID() string
- func (obj *Thread) GetText() string
- func (thread *Thread) HTML() string
- func (obj *Thread) IsLocked() bool
- func (obj *Thread) Like(userID UserID)
- func (obj *Thread) LikedBy(userID UserID) bool
- func (thread *Thread) Link() string
- func (obj *Thread) Lock(userID UserID)
- func (thread *Thread) OnAppend(ctx aero.Context, key string, index int, obj interface{})
- func (thread *Thread) OnLike(likedBy *User)
- func (thread *Thread) OnLock(user *User)
- func (thread *Thread) OnRemove(ctx aero.Context, key string, index int, obj interface{})
- func (thread *Thread) OnUnlock(user *User)
- func (thread *Thread) Parent() PostParent
- func (obj *Thread) Posts() []*Post
- func (obj *Thread) PostsRelevantFirst(count int) []*Post
- func (obj *Thread) RemovePost(postID string) bool
- func (thread *Thread) Save()
- func (thread *Thread) Self() Loggable
- func (thread *Thread) String() string
- func (thread *Thread) TitleByUser(user *User) string
- func (thread *Thread) TypeName() string
- func (obj *Thread) Unlike(userID UserID)
- func (obj *Thread) Unlock(userID UserID)
- type TwitterToUser
- type UpcomingEpisode
- type User
- func AllUsers() ([]*User, error)
- func FilterUsers(filter func(*User) bool) []*User
- func GetUser(id UserID) (*User, error)
- func GetUserByEmail(email string) (*User, error)
- func GetUserByFacebookID(facebookID string) (*User, error)
- func GetUserByGoogleID(googleID string) (*User, error)
- func GetUserByNick(nick string) (*User, error)
- func GetUserByTwitterID(twitterID string) (*User, error)
- func GetUserFromContext(ctx aero.Context) *User
- func NewUser() *User
- func (user *User) ActivateItemEffect(itemID string) error
- func (user *User) AddEventStream(stream *aero.EventStream)
- func (obj *User) AddPost(postID string)
- func (user *User) AgeInYears() int
- func (user *User) Analytics() *Analytics
- func (user *User) AnimeList() *AnimeList
- func (user *User) Authorize(ctx aero.Context, action string) error
- func (user *User) AvatarLink(size string) string
- func (user *User) BroadcastEvent(event *aero.Event)
- func (user *User) CleanNick() string
- func (user *User) ConnectFacebook(facebookID string)
- func (user *User) ConnectGoogle(googleID string)
- func (user *User) ConnectTwitter(twtterID string)
- func (obj *User) CountPosts() int
- func (user *User) CoverLink(size string) string
- func (user *User) Creator() *User
- func (user *User) CreatorID() UserID
- func (user *User) DraftIndex() *DraftIndex
- func (user *User) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
- func (user *User) EditorScore() int
- func (user *User) ExtendProDuration(duration time.Duration)
- func (user *User) Filter()
- func (user *User) Followers() []*User
- func (user *User) FollowersCount() int
- func (user *User) Follows() *UserFollows
- func (user *User) ForceSetNick(newName string)
- func (user *User) GetID() string
- func (user *User) Gravatar() string
- func (user *User) HasAvatar() bool
- func (user *User) HasBasicInfo() bool
- func (user *User) HasNick() bool
- func (user *User) Inventory() *Inventory
- func (user *User) IsActive() bool
- func (user *User) IsPro() bool
- func (user *User) LastActivityConsumeAnime(animeID string) *ActivityConsumeAnime
- func (user *User) LastSeenTime() time.Time
- func (user *User) Link() string
- func (user *User) Notifications() *UserNotifications
- func (obj *User) Posts() []*Post
- func (obj *User) PostsRelevantFirst(count int) []*Post
- func (user *User) PushSubscriptions() *PushSubscriptions
- func (user *User) RealName() string
- func (user *User) RefreshFFXIVInfo() error
- func (user *User) RefreshOsuInfo() error
- func (user *User) RefreshOverwatchInfo() error
- func (user *User) RegisteredTime() time.Time
- func (user *User) RemoveEventStream(stream *aero.EventStream) bool
- func (obj *User) RemovePost(postID string) bool
- func (user *User) Save()
- func (user *User) Self() Loggable
- func (user *User) SendNotification(pushNotification *PushNotification)
- func (user *User) SetAvatar(avatar *imageserver.MetaImage) error
- func (user *User) SetAvatarBytes(data []byte) error
- func (user *User) SetCover(cover *imageserver.MetaImage) error
- func (user *User) SetCoverBytes(data []byte) error
- func (user *User) SetEmail(newEmail string) error
- func (user *User) SetNick(newName string) error
- func (user *User) Settings() *Settings
- func (user *User) ShouldFilter(ctx aero.Context) bool
- func (user *User) SoundTracks() []*SoundTrack
- func (user *User) Threads() []*Thread
- func (user *User) TimeSinceRegistered() time.Duration
- func (user *User) TitleByUser(viewUser *User) string
- func (user *User) TypeName() string
- func (user *User) WebsiteShortURL() string
- func (user *User) WebsiteURL() string
- type UserAccounts
- type UserAvatar
- type UserBrowser
- type UserCover
- type UserFollows
- func (list *UserFollows) Add(userID UserID) error
- func (list *UserFollows) Authorize(ctx aero.Context, action string) error
- func (list *UserFollows) Contains(userID UserID) bool
- func (list *UserFollows) Remove(userID UserID) bool
- func (list *UserFollows) Save()
- func (list *UserFollows) Users() []*User
- func (list *UserFollows) UsersWhoFollowBack() []*User
- type UserID
- type UserListProviders
- type UserNotifications
- func (list *UserNotifications) Add(notificationID string) error
- func (list *UserNotifications) Contains(notificationID string) bool
- func (list *UserNotifications) CountUnseen() int
- func (list *UserNotifications) Notifications() []*Notification
- func (list *UserNotifications) Remove(notificationID string) bool
- func (list *UserNotifications) Save()
- type UserOS
Constants ¶
const ( // AnimeImageLargeWidth is the minimum width in pixels of a large anime image. AnimeImageLargeWidth = 250 // AnimeImageLargeHeight is the minimum height in pixels of a large anime image. AnimeImageLargeHeight = 350 // AnimeImageMediumWidth is the minimum width in pixels of a medium anime image. AnimeImageMediumWidth = 142 // AnimeImageMediumHeight is the minimum height in pixels of a medium anime image. AnimeImageMediumHeight = 200 // AnimeImageSmallWidth is the minimum width in pixels of a small anime image. AnimeImageSmallWidth = 55 // AnimeImageSmallHeight is the minimum height in pixels of a small anime image. AnimeImageSmallHeight = 78 // AnimeImageWebPQuality is the WebP quality of anime images. AnimeImageWebPQuality = 70 // AnimeImageJPEGQuality is the JPEG quality of anime images. AnimeImageJPEGQuality = 70 // AnimeImageQualityBonusLowDPI ... AnimeImageQualityBonusLowDPI = 10 // AnimeImageQualityBonusLarge ... AnimeImageQualityBonusLarge = 5 // AnimeImageQualityBonusMedium ... AnimeImageQualityBonusMedium = 10 // AnimeImageQualityBonusSmall ... AnimeImageQualityBonusSmall = 10 )
const ( AnimeListStatusWatching = "watching" AnimeListStatusCompleted = "completed" AnimeListStatusPlanned = "planned" AnimeListStatusHold = "hold" AnimeListStatusDropped = "dropped" )
AnimeListStatus values for anime list items
const ( // CharacterImageLargeWidth is the minimum width in pixels of a large character image. // We subtract 6 pixels due to border removal which can remove up to 6 pixels. CharacterImageLargeWidth = 225 - 6 // CharacterImageLargeHeight is the minimum height in pixels of a large character image. // We subtract 6 pixels due to border removal which can remove up to 6 pixels. CharacterImageLargeHeight = 350 - 6 // CharacterImageMediumWidth is the minimum width in pixels of a medium character image. CharacterImageMediumWidth = 112 // CharacterImageMediumHeight is the minimum height in pixels of a medium character image. CharacterImageMediumHeight = 112 // CharacterImageSmallWidth is the minimum width in pixels of a small character image. CharacterImageSmallWidth = 56 // CharacterImageSmallHeight is the minimum height in pixels of a small character image. CharacterImageSmallHeight = 56 // CharacterImageWebPQuality is the WebP quality of character images. CharacterImageWebPQuality = 70 // CharacterImageJPEGQuality is the JPEG quality of character images. CharacterImageJPEGQuality = 70 // CharacterImageQualityBonusLowDPI ... CharacterImageQualityBonusLowDPI = 12 // CharacterImageQualityBonusLarge ... CharacterImageQualityBonusLarge = 10 // CharacterImageQualityBonusMedium ... CharacterImageQualityBonusMedium = 15 // CharacterImageQualityBonusSmall ... CharacterImageQualityBonusSmall = 15 )
const ( // GroupImageSmallWidth is the minimum width in pixels of a small group image. GroupImageSmallWidth = 70 // GroupImageSmallHeight is the minimum height in pixels of a small group image. GroupImageSmallHeight = 70 // GroupImageLargeWidth is the minimum width in pixels of a large group image. GroupImageLargeWidth = 280 // GroupImageLargeHeight is the minimum height in pixels of a large group image. GroupImageLargeHeight = 280 // GroupImageWebPQuality is the WebP quality of group images. GroupImageWebPQuality = 70 // GroupImageJPEGQuality is the JPEG quality of group images. GroupImageJPEGQuality = 70 // GroupImageQualityBonusLowDPI ... GroupImageQualityBonusLowDPI = 12 // GroupImageQualityBonusLarge ... GroupImageQualityBonusLarge = 10 // GroupImageQualityBonusSmall ... GroupImageQualityBonusSmall = 15 )
const ( NotificationTypeTest = "test" NotificationTypeAnimeEpisode = "anime-episode" NotificationTypeAnimeFinished = "anime-finished" NotificationTypeForumReply = "forum-reply" NotificationTypeFollow = "follow" NotificationTypeLike = "like" NotificationTypePurchase = "purchase" NotificationTypePackageTest = "package-test" NotificationTypeGroupJoin = "group-join" )
NotificationType values
const ( // SortByAiringDate sorts your watching list by airing date. SortByAiringDate = "airing date" // SortByTitle sorts your watching list alphabetically. SortByTitle = "title" // SortByRating sorts your watching list by rating. SortByRating = "rating" )
const ( // TitleLanguageCanonical ... TitleLanguageCanonical = "canonical" // TitleLanguageRomaji ... TitleLanguageRomaji = "romaji" // TitleLanguageEnglish ... TitleLanguageEnglish = "english" // TitleLanguageJapanese ... TitleLanguageJapanese = "japanese" )
const ( // ShopItemRarityCommon ... ShopItemRarityCommon = "common" // ShopItemRaritySuperior ... ShopItemRaritySuperior = "superior" // ShopItemRarityRare ... ShopItemRarityRare = "rare" // ShopItemRarityUnique ... ShopItemRarityUnique = "unique" // ShopItemRarityLegendary ... ShopItemRarityLegendary = "legendary" )
const ( // AvatarSmallSize is the minimum size in pixels of an avatar. AvatarSmallSize = 100 // AvatarMaxSize is the maximum size in pixels of an avatar. AvatarMaxSize = 560 // AvatarWebPQuality is the WebP quality of avatars. AvatarWebPQuality = 80 // AvatarJPEGQuality is the JPEG quality of avatars. AvatarJPEGQuality = 80 )
const ( // CoverMaxWidth is the maximum size for covers. CoverMaxWidth = 1920 // CoverMaxHeight is the maximum height for covers. CoverMaxHeight = 450 // CoverSmallWidth is the width used for mobile phones. CoverSmallWidth = 640 // CoverSmallHeight is the height used for mobile phones. CoverSmallHeight = 640 // CoverWebPQuality is the WebP quality of cover images. CoverWebPQuality = AvatarWebPQuality // CoverJPEGQuality is the JPEG quality of cover images. CoverJPEGQuality = CoverWebPQuality )
const AnimeDateFormat = validate.DateFormat
AnimeDateFormat describes the anime date format for the date conversion.
const AverageRating = 5.0
AverageRating is the center rating in the system. Note that the mathematically correct center would be a little higher, but we don't care about these slight offsets.
const BotUserID = "3wUBnfUkR"
BotUserID is the user ID of the anime notifier bot.
const DefaultInventorySlotCount = 24
DefaultInventorySlotCount tells you how many slots are available by default in an inventory.
const DefaultRating = 0.0
DefaultRating is the default rating value.
const EarthRadius = 6371
EarthRadius is the radius of the earth in kilometers.
const IgnoreAnimeDifferenceEditorScore = 2
IgnoreAnimeDifferenceEditorScore represents how many points you get for a diff ignore.
const MaxRating = 10.0
MaxRating is the maximum rating users can give.
const RatingCountThreshold = 4
RatingCountThreshold is the number of users threshold that, when passed, doesn't dampen the result.
Variables ¶
var API = api.New("/api/", DB)
API ...
var AnimeSourceHumanReadable = map[string]string{}
AnimeSourceHumanReadable maps the anime source to a human readable version.
var DB = Node.Namespace("arn").RegisterTypes( (*ActivityCreate)(nil), (*ActivityConsumeAnime)(nil), (*AMV)(nil), (*Analytics)(nil), (*Anime)(nil), (*AnimeCharacters)(nil), (*AnimeEpisodes)(nil), (*AnimeRelations)(nil), (*AnimeList)(nil), (*Character)(nil), (*ClientErrorReport)(nil), (*Company)(nil), (*DraftIndex)(nil), (*EditLogEntry)(nil), (*EmailToUser)(nil), (*FacebookToUser)(nil), (*GoogleToUser)(nil), (*Group)(nil), (*IDList)(nil), (*IgnoreAnimeDifference)(nil), (*Inventory)(nil), (*NickToUser)(nil), (*Notification)(nil), (*PayPalPayment)(nil), (*Person)(nil), (*Post)(nil), (*Purchase)(nil), (*PushSubscriptions)(nil), (*Quote)(nil), (*Session)(nil), (*Settings)(nil), (*ShopItem)(nil), (*SoundTrack)(nil), (*Thread)(nil), (*TwitterToUser)(nil), (*User)(nil), (*UserFollows)(nil), (*UserNotifications)(nil), )
DB is the main database client.
var DataLists = map[string][]*Option{}
DataLists maps an ID to a list of keys and values. Used for selection lists in UIs.
var Genres []string
Genres ...
var JapaneseTokenizer = &client.Tokenizer{
Endpoint: "http://127.0.0.1:6000/",
}
JapaneseTokenizer tokenizes a sentence via the HTTP API.
var Kitsu = Node.Namespace("kitsu").RegisterTypes( (*kitsu.Anime)(nil), (*kitsu.Mapping)(nil), (*kitsu.Character)(nil), )
Kitsu is the client for the Kitsu database.
var MAL = Node.Namespace("mal").RegisterTypes( (*mal.Anime)(nil), (*mal.Character)(nil), )
MAL is the client for the MyAnimeList database.
var (
// MediaHost is the host we use to link image files.
MediaHost = "media.notify.moe"
)
var Node = nano.New(nano.Configuration{
Port: 5000,
})
Node represents the database node.
var Nyaa = new(nyaaAnimeProvider)
Nyaa anime provider (singleton)
var OriginalImageExtensions = []string{
".jpg",
".png",
".gif",
}
OriginalImageExtensions includes all the formats that an avatar source could have sent to us.
var Root = os.Getenv("ARN_ROOT")
Root is the full path to the root directory of notify.moe repository.
Functions ¶
func AgeInYears ¶
AgeInYears returns the person's age in years.
func AllKitsuAnime ¶
AllKitsuAnime returns a slice of all Kitsu anime.
func AniListAnimeListStatus ¶
func AniListAnimeListStatus(item *anilist.AnimeListItem) string
AniListAnimeListStatus returns the ARN version of the anime status.
func AnimeRatingStars ¶
AnimeRatingStars displays the rating in Unicode stars.
func AuthorizeIfLoggedIn ¶
AuthorizeIfLoggedIn authorizes the given request if a user is logged in.
func AuthorizeIfLoggedInAndOwnData ¶
AuthorizeIfLoggedInAndOwnData authorizes the given request if a user is logged in and the user ID matches the ID in the request.
func BroadcastEvent ¶
BroadcastEvent sends the given event to the event streams of all users.
func CreateDifferenceID ¶
func CreateDifferenceID(animeID string, dataProvider string, malAnimeID string, typeName string) string
CreateDifferenceID ...
func DateTimeUTC ¶
func DateTimeUTC() string
DateTimeUTC returns the current UTC time in RFC3339 format.
func DateToSeason ¶
DateToSeason returns the season of the year for the given date.
func EpisodeCountMax ¶
EpisodeCountMax is used for the max value of number input on episodes.
func EpisodesToString ¶
EpisodesToString shows a question mark if the episode count is zero.
func FilterIDTags ¶
FilterIDTags returns all IDs of the given type in the tag list.
func FilterKitsuAnime ¶
FilterKitsuAnime filters all Kitsu anime by a custom function.
func FilterKitsuMappings ¶
FilterKitsuMappings filters all Kitsu mappings by a custom function.
func FindFileWithExtension ¶
FindFileWithExtension tries to test different file extensions.
func FixAnimeDescription ¶
FixAnimeDescription ...
func GenerateID ¶
GenerateID generates a unique ID for a given collection.
func GetCompanyToAnimeMap ¶
GetCompanyToAnimeMap returns a map that contains company IDs as keys and their anime as values.
func GetForumIcon ¶
GetForumIcon returns the unprefixed icon class name for the forum.
func GetGenreIcon ¶
GetGenreIcon returns the unprefixed icon class name for the genre.
func HumanReadableAnimeRelation ¶
HumanReadableAnimeRelation ...
func IsAnimeDifferenceIgnored ¶
func IsAnimeDifferenceIgnored(animeID string, dataProvider string, malAnimeID string, typeName string, hash uint64) bool
IsAnimeDifferenceIgnored tells you whether the given difference is being ignored.
func IsDevelopment ¶
func IsDevelopment() bool
IsDevelopment returns true if the hostname does not contain "arn".
func IsLocked ¶
func IsLocked(obj interface{}) bool
IsLocked returns true if the given object is locked.
func IsProduction ¶
func IsProduction() bool
IsProduction returns true if the hostname contains "arn".
func IsTest ¶
func IsTest() bool
IsTest returns true if the program is currently running in the "go test" tool.
func JoinAction ¶
JoinAction returns an API action that lets the user join the object.
func KitsuStatusToARNStatus ¶
KitsuStatusToARNStatus ...
func LeaveAction ¶
LeaveAction returns an API action that unpublishes the object.
func MyAnimeListStatusToARNStatus ¶
MyAnimeListStatusToARNStatus ...
func NewAnimeFromKitsuAnime ¶
func NewAnimeFromKitsuAnime(kitsuAnime *kitsu.Anime) (*Anime, *AnimeCharacters, *AnimeRelations, *AnimeEpisodes)
NewAnimeFromKitsuAnime ...
func OverallRatingName ¶
OverallRatingName returns Overall in general, but Hype when episodes watched is zero.
func PublishAction ¶
PublishAction returns an API action that publishes the object.
func RGBToHSL ¶
RGBToHSL converts RGB to HSL (RGB input and HSL output are floats in the 0..1 range). Original source: https://github.com/gerow/go-color
func RegisterUser ¶
func RegisterUser(user *User)
RegisterUser registers a new user in the database and sets up all the required references.
func RemoveAction ¶
RemoveAction returns an API action that removes an item from the IDCollection.
func SetObjectProperties ¶
SetObjectProperties updates the object with the given map[string]interface{}
func SortActivitiesLatestFirst ¶
func SortActivitiesLatestFirst(entries []Activity)
SortActivitiesLatestFirst puts the latest entries on top.
func SortAnimeByPopularity ¶
func SortAnimeByPopularity(animes []*Anime)
SortAnimeByPopularity sorts the given slice of anime by popularity.
func SortAnimeByQuality ¶
func SortAnimeByQuality(animes []*Anime)
SortAnimeByQuality sorts the given slice of anime by quality.
func SortAnimeByQualityDetailed ¶
SortAnimeByQualityDetailed sorts the given slice of anime by quality.
func SortCharactersByLikes ¶
func SortCharactersByLikes(characters []*Character)
SortCharactersByLikes sorts the given slice of characters by the amount of likes.
func SortCompaniesPopularFirst ¶
func SortCompaniesPopularFirst(companies []*Company)
SortCompaniesPopularFirst ...
func SortEditLogEntriesLatestFirst ¶
func SortEditLogEntriesLatestFirst(entries []*EditLogEntry)
SortEditLogEntriesLatestFirst puts the latest entries on top.
func SortPersonsByLikes ¶
func SortPersonsByLikes(persons []*Person)
SortPersonsByLikes sorts the given slice of persons by the amount of likes.
func SortPostablesLatestFirst ¶
func SortPostablesLatestFirst(posts []Postable)
SortPostablesLatestFirst ...
func SortPostsLatestFirst ¶
func SortPostsLatestFirst(posts []*Post)
SortPostsLatestFirst sorts the slice of posts.
func SortPostsLatestLast ¶
func SortPostsLatestLast(posts []*Post)
SortPostsLatestLast sorts the slice of posts.
func SortQuotesPopularFirst ¶
func SortQuotesPopularFirst(quotes []*Quote)
SortQuotesPopularFirst ...
func SortSoundTracksLatestFirst ¶
func SortSoundTracksLatestFirst(tracks []*SoundTrack)
SortSoundTracksLatestFirst ...
func SortSoundTracksPopularFirst ¶
func SortSoundTracksPopularFirst(tracks []*SoundTrack)
SortSoundTracksPopularFirst ...
func SortThreads ¶
func SortThreads(threads []*Thread)
SortThreads sorts a slice of threads for the forum view (stickies first).
func SortThreadsLatestFirst ¶
func SortThreadsLatestFirst(threads []*Thread)
SortThreadsLatestFirst sorts a slice of threads by creation date.
func SortUsersFollowers ¶
func SortUsersFollowers(users []*User)
SortUsersFollowers sorts a list of users by their number of followers.
func SortUsersLastSeenFirst ¶
func SortUsersLastSeenFirst(users []*User)
SortUsersLastSeenFirst sorts a list of users by their last seen date.
func SortUsersLastSeenLast ¶
func SortUsersLastSeenLast(users []*User)
SortUsersLastSeenLast sorts a list of users by their last seen date.
func StreamActivities ¶
func StreamActivities() <-chan Activity
StreamActivities returns a stream of all activities.
func StreamActivityCreates ¶
func StreamActivityCreates() <-chan *ActivityCreate
StreamActivityCreates returns a stream of all ActivityCreate objects.
func StreamAnalytics ¶
func StreamAnalytics() <-chan *Analytics
StreamAnalytics returns a stream of all analytics.
func StreamAnimeCharacters ¶
func StreamAnimeCharacters() <-chan *AnimeCharacters
StreamAnimeCharacters returns a stream of all anime characters.
func StreamAnimeEpisodes ¶
func StreamAnimeEpisodes() <-chan *AnimeEpisodes
StreamAnimeEpisodes returns a stream of all anime episodes.
func StreamAnimeLists ¶
func StreamAnimeLists() <-chan *AnimeList
StreamAnimeLists returns a stream of all anime.
func StreamAnimeRelations ¶
func StreamAnimeRelations() <-chan *AnimeRelations
StreamAnimeRelations returns a stream of all anime relations.
func StreamCharacters ¶
func StreamCharacters() <-chan *Character
StreamCharacters returns a stream of all characters.
func StreamClientErrorReports ¶
func StreamClientErrorReports() <-chan *ClientErrorReport
StreamClientErrorReports returns a stream of all characters.
func StreamCompanies ¶
func StreamCompanies() <-chan *Company
StreamCompanies returns a stream of all companies.
func StreamEditLogEntries ¶
func StreamEditLogEntries() <-chan *EditLogEntry
StreamEditLogEntries returns a stream of all log entries.
func StreamIgnoreAnimeDifferences ¶
func StreamIgnoreAnimeDifferences() <-chan *IgnoreAnimeDifference
StreamIgnoreAnimeDifferences returns a stream of all ignored differences.
func StreamKitsuAnime ¶
StreamKitsuAnime returns a stream of all Kitsu anime.
func StreamKitsuMappings ¶
StreamKitsuMappings returns a stream of all Kitsu mappings.
func StreamNotifications ¶
func StreamNotifications() <-chan *Notification
StreamNotifications returns a stream of all notifications.
func StreamPayPalPayments ¶
func StreamPayPalPayments() <-chan *PayPalPayment
StreamPayPalPayments returns a stream of all paypal payments.
func StreamPersons ¶
func StreamPersons() <-chan *Person
StreamPersons returns a stream of all persons.
func StreamPurchases ¶
func StreamPurchases() <-chan *Purchase
StreamPurchases returns a stream of all purchases.
func StreamShopItems ¶
func StreamShopItems() <-chan *ShopItem
StreamShopItems returns a stream of all shop items.
func StreamSoundTracks ¶
func StreamSoundTracks() <-chan *SoundTrack
StreamSoundTracks returns a stream of all soundtracks.
func StreamUserFollows ¶
func StreamUserFollows() <-chan *UserFollows
StreamUserFollows returns a stream of all user follows.
func StreamUserNotifications ¶
func StreamUserNotifications() <-chan *UserNotifications
StreamUserNotifications returns a stream of all user notifications.
func UnpublishAction ¶
UnpublishAction returns an API action that unpublishes the object.
func UserFollowerCountMap ¶
UserFollowerCountMap returns a map of user ID keys and their corresping number of followers as the value.
Types ¶
type AMV ¶
type AMV struct { File string `json:"file" editable:"true" type:"upload" filetype:"video" endpoint:"/api/upload/amv/:id/file"` Title AMVTitle `json:"title" editable:"true"` MainAnimeID string `json:"mainAnimeId" editable:"true"` ExtraAnimeIDs []string `json:"extraAnimeIds" editable:"true"` VideoEditorIDs []string `json:"videoEditorIds" editable:"true"` Links []Link `json:"links" editable:"true"` Tags []string `json:"tags" editable:"true"` Info video.Info `json:"info"` // contains filtered or unexported fields }
AMV is an anime music video.
func FilterAMVs ¶
FilterAMVs filters all AMVs by a custom function.
func (*AMV) AddPost ¶ added in v1.1.25
func (obj *AMV) AddPost(postID string)
AddPost adds a post to the object.
func (*AMV) CountLikes ¶ added in v1.1.25
func (obj *AMV) CountLikes() int
CountLikes returns the number of likes the object has received.
func (*AMV) CountPosts ¶ added in v1.1.25
func (obj *AMV) CountPosts() int
CountPosts returns the number of posts written for this object.
func (*AMV) Creator ¶ added in v1.1.25
func (obj *AMV) Creator() *User
Creator returns the user who created this object.
func (*AMV) CreatorID ¶ added in v1.1.25
func (obj *AMV) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*AMV) DeleteInContext ¶
DeleteInContext deletes the amv in the given context.
func (*AMV) Edit ¶
func (amv *AMV) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
Edit creates an edit log entry.
func (*AMV) Editor ¶ added in v1.1.25
func (obj *AMV) Editor() *User
Editor returns the user who last edited this object.
func (*AMV) ExtraAnime ¶
ExtraAnime returns main anime for the AMV, if available.
func (*AMV) GetCreated ¶ added in v1.1.25
func (obj *AMV) GetCreated() string
GetCreated returns the creation time of the object.
func (*AMV) GetCreatedBy ¶ added in v1.1.25
func (obj *AMV) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*AMV) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*AMV) GetIsDraft ¶ added in v1.1.25
func (obj *AMV) GetIsDraft() bool
GetIsDraft tells you whether the object is a draft or not.
func (*AMV) Like ¶ added in v1.1.25
func (obj *AMV) Like(userID UserID)
Like makes the given user ID like the object.
func (*AMV) Posts ¶ added in v1.1.25
func (obj *AMV) Posts() []*Post
Posts returns a slice of all posts.
func (*AMV) PostsRelevantFirst ¶ added in v1.1.25
PostsRelevantFirst returns a slice of all posts sorted by relevance.
func (*AMV) RefreshInfo ¶
RefreshInfo refreshes the information about the video file.
func (*AMV) RemovePost ¶ added in v1.1.25
RemovePost removes a post from the object.
func (*AMV) SetIsDraft ¶ added in v1.1.25
func (obj *AMV) SetIsDraft(isDraft bool)
SetIsDraft sets the draft state for this object.
func (*AMV) SetVideoBytes ¶
SetVideoBytes sets the bytes for the video file.
func (*AMV) TitleByUser ¶
TitleByUser returns the preferred title for the given user.
func (*AMV) Unlike ¶ added in v1.1.25
func (obj *AMV) Unlike(userID UserID)
Unlike makes the given user ID unlike the object.
func (*AMV) VideoEditors ¶
VideoEditors returns a slice of all the users involved in creating the AMV.
type AMVTitle ¶
type AMVTitle SoundTrackTitle
AMVTitle is the same as a soundtrack title.
type APIKeysData ¶
type APIKeysData struct { Google struct { ID string `json:"id"` Secret string `json:"secret"` } `json:"google"` Facebook struct { ID string `json:"id"` Secret string `json:"secret"` } `json:"facebook"` Twitter struct { ID string `json:"id"` Secret string `json:"secret"` } `json:"twitter"` Discord struct { ID string `json:"id"` Secret string `json:"secret"` Token string `json:"token"` } `json:"discord"` SoundCloud struct { ID string `json:"id"` Secret string `json:"secret"` } `json:"soundcloud"` GoogleAPI struct { Key string `json:"key"` } `json:"googleAPI"` IPInfoDB struct { ID string `json:"id"` } `json:"ipInfoDB"` AniList struct { ID string `json:"id"` Secret string `json:"secret"` } `json:"anilist"` Osu struct { Secret string `json:"secret"` } `json:"osu"` PayPal struct { ID string `json:"id"` Secret string `json:"secret"` } `json:"paypal"` VAPID struct { Subject string `json:"subject"` PublicKey string `json:"publicKey"` PrivateKey string `json:"privateKey"` } `json:"vapid"` SMTP struct { Server string `json:"server"` Address string `json:"address"` Password string `json:"password"` } `json:"smtp"` S3 struct { ID string `json:"id"` Secret string `json:"secret"` } `json:"s3"` }
APIKeysData ...
var APIKeys APIKeysData
APIKeys are global API keys for several services
type Activity ¶
type Activity interface { Creator() *User TypeName() string GetID() string GetCreated() string GetCreatedBy() UserID GetCreatedTime() time.Time }
Activity is a user activity that appears in the follower's feeds.
func AllActivities ¶
func AllActivities() []Activity
AllActivities returns a slice of all activities.
func FilterActivities ¶
FilterActivities filters all Activities by a custom function.
type ActivityConsumeAnime ¶
type ActivityConsumeAnime struct { AnimeID string `json:"animeId"` FromEpisode int `json:"fromEpisode"` ToEpisode int `json:"toEpisode"` // contains filtered or unexported fields }
ActivityConsumeAnime is a user activity that consumes anime.
func FilterActivitiesConsumeAnime ¶
func FilterActivitiesConsumeAnime(filter func(*ActivityConsumeAnime) bool) []*ActivityConsumeAnime
FilterActivitiesConsumeAnime filters all anime consumption activities by a custom function.
func NewActivityConsumeAnime ¶
func NewActivityConsumeAnime(animeID string, fromEpisode int, toEpisode int, userID UserID) *ActivityConsumeAnime
NewActivityConsumeAnime creates a new activity.
func (*ActivityConsumeAnime) Anime ¶
func (activity *ActivityConsumeAnime) Anime() *Anime
Anime returns the anime.
func (*ActivityConsumeAnime) Authorize ¶
func (activity *ActivityConsumeAnime) Authorize(ctx aero.Context, action string) error
Authorize returns an error if the given API POST request is not authorized.
func (*ActivityConsumeAnime) CountLikes ¶ added in v1.1.25
func (obj *ActivityConsumeAnime) CountLikes() int
CountLikes returns the number of likes the object has received.
func (*ActivityConsumeAnime) Creator ¶ added in v1.1.25
func (obj *ActivityConsumeAnime) Creator() *User
Creator returns the user who created this object.
func (*ActivityConsumeAnime) CreatorID ¶ added in v1.1.25
func (obj *ActivityConsumeAnime) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*ActivityConsumeAnime) Delete ¶
func (activity *ActivityConsumeAnime) Delete() error
Delete deletes the object from the database.
func (*ActivityConsumeAnime) DeleteInContext ¶
func (activity *ActivityConsumeAnime) DeleteInContext(ctx aero.Context) error
DeleteInContext deletes the activity in the given context.
func (*ActivityConsumeAnime) GetCreated ¶ added in v1.1.25
func (obj *ActivityConsumeAnime) GetCreated() string
GetCreated returns the creation time of the object.
func (*ActivityConsumeAnime) GetCreatedBy ¶ added in v1.1.25
func (obj *ActivityConsumeAnime) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*ActivityConsumeAnime) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*ActivityConsumeAnime) GetID ¶ added in v1.1.25
func (obj *ActivityConsumeAnime) GetID() string
GetID returns the ID.
func (*ActivityConsumeAnime) Like ¶ added in v1.1.25
func (obj *ActivityConsumeAnime) Like(userID UserID)
Like makes the given user ID like the object.
func (*ActivityConsumeAnime) LikedBy ¶ added in v1.1.25
LikedBy checks to see if the user has liked the object.
func (*ActivityConsumeAnime) Save ¶
func (activity *ActivityConsumeAnime) Save()
Save saves the activity object in the database.
func (*ActivityConsumeAnime) Self ¶ added in v1.1.17
func (activity *ActivityConsumeAnime) Self() Loggable
Self returns the object itself.
func (*ActivityConsumeAnime) TypeName ¶
func (activity *ActivityConsumeAnime) TypeName() string
TypeName returns the type name.
type ActivityCreate ¶
type ActivityCreate struct { ObjectType string `json:"objectType"` ObjectID string `json:"objectId"` // contains filtered or unexported fields }
ActivityCreate is a user activity that creates something.
func NewActivityCreate ¶
func NewActivityCreate(objectType string, objectID string, userID UserID) *ActivityCreate
NewActivityCreate creates a new activity.
func (*ActivityCreate) Creator ¶ added in v1.1.25
func (obj *ActivityCreate) Creator() *User
Creator returns the user who created this object.
func (*ActivityCreate) CreatorID ¶ added in v1.1.25
func (obj *ActivityCreate) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*ActivityCreate) Delete ¶
func (activity *ActivityCreate) Delete() error
Delete deletes the activity object from the database.
func (*ActivityCreate) GetCreated ¶ added in v1.1.25
func (obj *ActivityCreate) GetCreated() string
GetCreated returns the creation time of the object.
func (*ActivityCreate) GetCreatedBy ¶ added in v1.1.25
func (obj *ActivityCreate) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*ActivityCreate) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*ActivityCreate) GetID ¶ added in v1.1.25
func (obj *ActivityCreate) GetID() string
GetID returns the ID.
func (*ActivityCreate) Object ¶
func (activity *ActivityCreate) Object() Likeable
Object returns the object that was created.
func (*ActivityCreate) Postable ¶
func (activity *ActivityCreate) Postable() Postable
Postable casts the object to the Postable interface.
func (*ActivityCreate) Save ¶
func (activity *ActivityCreate) Save()
Save saves the activity object in the database.
func (*ActivityCreate) Self ¶ added in v1.1.17
func (activity *ActivityCreate) Self() Loggable
Self returns the object itself.
func (*ActivityCreate) TypeName ¶
func (activity *ActivityCreate) TypeName() string
TypeName returns the type name.
type AiringDate ¶
type AiringDate struct { Start string `json:"start" editable:"true"` End string `json:"end" editable:"true"` }
AiringDate represents the airing date of an anime.
func (*AiringDate) EndDateHuman ¶
func (airing *AiringDate) EndDateHuman() string
EndDateHuman returns the end date of the anime in human readable form.
func (*AiringDate) EndTimeHuman ¶
func (airing *AiringDate) EndTimeHuman() string
EndTimeHuman returns the end time of the anime in human readable form.
func (*AiringDate) StartDateHuman ¶
func (airing *AiringDate) StartDateHuman() string
StartDateHuman returns the start date of the anime in human readable form.
func (*AiringDate) StartTimeHuman ¶
func (airing *AiringDate) StartTimeHuman() string
StartTimeHuman returns the start time of the anime in human readable form.
type Analytics ¶
type Analytics struct { UserID string `json:"userId"` General GeneralAnalytics `json:"general"` Screen ScreenAnalytics `json:"screen"` System SystemAnalytics `json:"system"` Connection ConnectionAnalytics `json:"connection"` }
Analytics stores user-related statistics.
func GetAnalytics ¶
GetAnalytics returns the analytics for the given user ID.
func (*Analytics) Authorize ¶
Authorize returns an error if the given API POST request is not authorized.
type AniListAnimeFinder ¶
type AniListAnimeFinder struct {
// contains filtered or unexported fields
}
AniListAnimeFinder holds an internal map of ID to anime mappings and is therefore very efficient to use when trying to find anime by a given service and ID.
func NewAniListAnimeFinder ¶
func NewAniListAnimeFinder() *AniListAnimeFinder
NewAniListAnimeFinder creates a new finder for Anilist anime.
type AniListMatch ¶
type AniListMatch struct { AniListItem *anilist.AnimeListItem `json:"anilistItem"` ARNAnime *Anime `json:"arnAnime"` }
AniListMatch ...
type Anime ¶
type Anime struct { Type string `json:"type" editable:"true" datalist:"anime-types"` Title *AnimeTitle `json:"title" editable:"true"` Summary string `json:"summary" editable:"true" type:"textarea"` Status string `json:"status" editable:"true" datalist:"anime-status"` Genres []string `json:"genres" editable:"true"` StartDate string `json:"startDate" editable:"true"` EndDate string `json:"endDate" editable:"true"` EpisodeCount int `json:"episodeCount" editable:"true"` EpisodeLength int `json:"episodeLength" editable:"true"` Source string `json:"source" editable:"true" datalist:"anime-sources"` Image AnimeImage `json:"image"` FirstChannel string `json:"firstChannel"` Rating *AnimeRating `json:"rating"` Popularity *AnimePopularity `json:"popularity"` Trailers []*ExternalMedia `json:"trailers" editable:"true"` // Company IDs StudioIDs []string `json:"studios" editable:"true"` ProducerIDs []string `json:"producers" editable:"true"` LicensorIDs []string `json:"licensors" editable:"true"` // Links to external websites Links []*Link `json:"links" editable:"true"` // contains filtered or unexported fields }
Anime represents an anime.
func FilterAnime ¶
FilterAnime filters all anime by a custom function.
func (*Anime) AddLicensor ¶
AddLicensor adds the company ID to the licensor ID list if it doesn't exist already.
func (*Anime) AddPost ¶ added in v1.1.25
func (obj *Anime) AddPost(postID string)
AddPost adds a post to the object.
func (*Anime) AddProducer ¶
AddProducer adds the company ID to the producer ID list if it doesn't exist already.
func (*Anime) AddStudio ¶
AddStudio adds the company ID to the studio ID list if it doesn't exist already.
func (*Anime) Authorize ¶
Authorize returns an error if the given API POST request is not authorized.
func (*Anime) AverageColor ¶
AverageColor returns the average color of the image.
func (*Anime) CalculatedStatus ¶
CalculatedStatus returns the status of the anime inferred by the start and end date.
func (*Anime) CountLikes ¶ added in v1.1.25
func (obj *Anime) CountLikes() int
CountLikes returns the number of likes the object has received.
func (*Anime) CountPosts ¶ added in v1.1.25
func (obj *Anime) CountPosts() int
CountPosts returns the number of posts written for this object.
func (*Anime) Creator ¶ added in v1.1.25
func (obj *Anime) Creator() *User
Creator returns the user who created this object.
func (*Anime) CreatorID ¶ added in v1.1.25
func (obj *Anime) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*Anime) DeleteInContext ¶
DeleteInContext deletes the anime in the given context.
func (*Anime) Edit ¶
func (anime *Anime) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
Edit creates an edit log entry.
func (*Anime) Editor ¶ added in v1.1.25
func (obj *Anime) Editor() *User
Editor returns the user who last edited this object.
func (*Anime) EndDateTime ¶
EndDateTime returns the end date as a time object.
func (*Anime) EpisodeByNumber ¶
func (anime *Anime) EpisodeByNumber(number int) *AnimeEpisode
EpisodeByNumber returns the episode with the given number.
func (*Anime) EpisodeCountString ¶
EpisodeCountString ...
func (*Anime) Episodes ¶
func (anime *Anime) Episodes() *AnimeEpisodes
Episodes returns the anime episodes wrapper.
func (*Anime) GetCreated ¶ added in v1.1.25
func (obj *Anime) GetCreated() string
GetCreated returns the creation time of the object.
func (*Anime) GetCreatedBy ¶ added in v1.1.25
func (obj *Anime) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*Anime) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*Anime) GetIsDraft ¶ added in v1.1.25
func (obj *Anime) GetIsDraft() bool
GetIsDraft tells you whether the object is a draft or not.
func (*Anime) GetMapping ¶ added in v1.1.25
GetMapping returns the external ID for the given service.
func (*Anime) ImportKitsuMapping ¶
ImportKitsuMapping imports the given Kitsu mapping.
func (*Anime) Like ¶ added in v1.1.25
func (obj *Anime) Like(userID UserID)
Like makes the given user ID like the object.
func (*Anime) Posts ¶ added in v1.1.25
func (obj *Anime) Posts() []*Post
Posts returns a slice of all posts.
func (*Anime) PostsRelevantFirst ¶ added in v1.1.25
PostsRelevantFirst returns a slice of all posts sorted by relevance.
func (*Anime) RefreshAnimeCharacters ¶
func (anime *Anime) RefreshAnimeCharacters() (*AnimeCharacters, error)
RefreshAnimeCharacters ...
func (*Anime) RefreshEpisodes ¶
RefreshEpisodes will refresh the episode data.
func (*Anime) RemoveMapping ¶ added in v1.1.25
RemoveMapping removes all mappings with the given service name and ID.
func (*Anime) RemovePost ¶ added in v1.1.25
RemovePost removes a post from the object.
func (*Anime) ScoreHumanReadable ¶
ScoreHumanReadable returns the score used for the anime ranking in human readable format.
func (*Anime) SetImage ¶
func (anime *Anime) SetImage(metaImage *imageserver.MetaImage) error
SetImage sets the anime image to the given MetaImage.
func (*Anime) SetImageBytes ¶
SetImageBytes accepts a byte buffer that represents an image file and updates the anime image.
func (*Anime) SetIsDraft ¶ added in v1.1.25
func (obj *Anime) SetIsDraft(isDraft bool)
SetIsDraft sets the draft state for this object.
func (*Anime) SetMapping ¶ added in v1.1.25
SetMapping sets the ID of an external site to the obj.
func (*Anime) ShoboiEpisodes ¶
func (anime *Anime) ShoboiEpisodes() ([]*AnimeEpisode, error)
ShoboiEpisodes returns a slice of episode info from cal.syoboi.jp.
func (*Anime) StartDateTime ¶
StartDateTime returns the start date as a time object.
func (*Anime) StatusHumanReadable ¶
StatusHumanReadable ...
func (*Anime) TitleByUser ¶
TitleByUser returns the preferred title for the given user.
func (*Anime) TwistEpisodes ¶
func (anime *Anime) TwistEpisodes() ([]*AnimeEpisode, error)
TwistEpisodes returns a slice of episode info from twist.moe.
func (*Anime) TypeHumanReadable ¶
TypeHumanReadable ...
func (*Anime) Unlike ¶ added in v1.1.25
func (obj *Anime) Unlike(userID UserID)
Unlike makes the given user ID unlike the object.
func (*Anime) UpcomingEpisode ¶
func (anime *Anime) UpcomingEpisode() *UpcomingEpisode
UpcomingEpisode ...
func (*Anime) UpcomingEpisodes ¶
func (anime *Anime) UpcomingEpisodes() []*UpcomingEpisode
UpcomingEpisodes ...
func (*Anime) UsersWatchingOrPlanned ¶
UsersWatchingOrPlanned returns a list of users who are watching the anime right now.
type AnimeCharacter ¶
type AnimeCharacter struct { CharacterID string `json:"characterId" editable:"true"` Role string `json:"role" editable:"true" datalist:"anime-character-roles"` }
AnimeCharacter ...
type AnimeCharacters ¶
type AnimeCharacters struct { AnimeID string `json:"animeId" mainID:"true"` Items []*AnimeCharacter `json:"items" editable:"true"` sync.Mutex }
AnimeCharacters is a list of characters for an anime.
func GetAnimeCharacters ¶
func GetAnimeCharacters(animeID string) (*AnimeCharacters, error)
GetAnimeCharacters ...
func (*AnimeCharacters) Add ¶
func (characters *AnimeCharacters) Add(animeCharacter *AnimeCharacter) error
Add adds an anime character to the list.
func (*AnimeCharacters) Anime ¶
func (characters *AnimeCharacters) Anime() *Anime
Anime returns the anime the characters refer to.
func (*AnimeCharacters) Authorize ¶
func (characters *AnimeCharacters) Authorize(ctx aero.Context, action string) error
Authorize returns an error if the given API POST request is not authorized.
func (*AnimeCharacters) Contains ¶
func (characters *AnimeCharacters) Contains(characterID string) bool
Contains tells you whether the given character ID exists.
func (*AnimeCharacters) Delete ¶
func (characters *AnimeCharacters) Delete() error
Delete deletes the character list from the database.
func (*AnimeCharacters) Edit ¶
func (characters *AnimeCharacters) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
Edit creates an edit log entry.
func (*AnimeCharacters) FindByMapping ¶
func (characters *AnimeCharacters) FindByMapping(service string, serviceID string) *AnimeCharacter
FindByMapping finds an anime character by the given mapping.
func (*AnimeCharacters) First ¶
func (characters *AnimeCharacters) First(count int) []*AnimeCharacter
First gives you the first "count" anime characters.
func (*AnimeCharacters) GetID ¶
func (characters *AnimeCharacters) GetID() string
GetID returns the anime ID.
func (*AnimeCharacters) Link ¶
func (characters *AnimeCharacters) Link() string
Link returns the link for that object.
func (*AnimeCharacters) OnAppend ¶
func (characters *AnimeCharacters) OnAppend(ctx aero.Context, key string, index int, obj interface{})
OnAppend saves a log entry.
func (*AnimeCharacters) OnRemove ¶
func (characters *AnimeCharacters) OnRemove(ctx aero.Context, key string, index int, obj interface{})
OnRemove saves a log entry.
func (*AnimeCharacters) Save ¶
func (characters *AnimeCharacters) Save()
Save saves the character in the database.
func (*AnimeCharacters) Self ¶ added in v1.1.17
func (characters *AnimeCharacters) Self() Loggable
Self returns the object itself.
func (*AnimeCharacters) String ¶
func (characters *AnimeCharacters) String() string
String implements the default string serialization.
func (*AnimeCharacters) TypeName ¶
func (characters *AnimeCharacters) TypeName() string
TypeName returns the type name.
type AnimeEpisode ¶
type AnimeEpisode struct { Number int `json:"number" editable:"true"` Title EpisodeTitle `json:"title" editable:"true"` AiringDate AiringDate `json:"airingDate" editable:"true"` Links map[string]string `json:"links"` }
AnimeEpisode ...
func NewAnimeEpisode ¶
func NewAnimeEpisode() *AnimeEpisode
NewAnimeEpisode creates an empty anime episode.
func (*AnimeEpisode) Available ¶
func (a *AnimeEpisode) Available() bool
Available tells you whether the episode is available (triggered when it has a link).
func (*AnimeEpisode) AvailableOn ¶
func (a *AnimeEpisode) AvailableOn(serviceName string) bool
AvailableOn tells you whether the episode is available on a given service.
func (*AnimeEpisode) Merge ¶
func (a *AnimeEpisode) Merge(b *AnimeEpisode)
Merge combines the data of both episodes to one.
type AnimeEpisodes ¶
type AnimeEpisodes struct { AnimeID string `json:"animeId" mainID:"true"` Items []*AnimeEpisode `json:"items" editable:"true"` sync.Mutex }
AnimeEpisodes is a list of episodes for an anime.
func GetAnimeEpisodes ¶
func GetAnimeEpisodes(id string) (*AnimeEpisodes, error)
GetAnimeEpisodes ...
func (*AnimeEpisodes) Anime ¶
func (episodes *AnimeEpisodes) Anime() *Anime
Anime returns the anime the episodes refer to.
func (*AnimeEpisodes) Authorize ¶
func (episodes *AnimeEpisodes) Authorize(ctx aero.Context, action string) error
Authorize returns an error if the given API POST request is not authorized.
func (*AnimeEpisodes) AvailableCount ¶
func (episodes *AnimeEpisodes) AvailableCount() int
AvailableCount counts the number of available episodes.
func (*AnimeEpisodes) Delete ¶
func (episodes *AnimeEpisodes) Delete() error
Delete deletes the episode list from the database.
func (*AnimeEpisodes) Edit ¶
func (episodes *AnimeEpisodes) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
Edit creates an edit log entry.
func (*AnimeEpisodes) Find ¶
func (episodes *AnimeEpisodes) Find(episodeNumber int) (*AnimeEpisode, int)
Find finds the given episode number.
func (*AnimeEpisodes) GetID ¶
func (episodes *AnimeEpisodes) GetID() string
GetID returns the anime ID.
func (*AnimeEpisodes) Last ¶
func (episodes *AnimeEpisodes) Last(count int) []*AnimeEpisode
Last returns the last n items.
func (*AnimeEpisodes) Link ¶
func (episodes *AnimeEpisodes) Link() string
Link returns the link for that object.
func (*AnimeEpisodes) ListString ¶
func (episodes *AnimeEpisodes) ListString() string
ListString returns a text representation of the anime episodes.
func (*AnimeEpisodes) Merge ¶
func (episodes *AnimeEpisodes) Merge(b []*AnimeEpisode)
Merge combines the data of both episode slices to one.
func (*AnimeEpisodes) OnAppend ¶
func (episodes *AnimeEpisodes) OnAppend(ctx aero.Context, key string, index int, obj interface{})
OnAppend saves a log entry.
func (*AnimeEpisodes) OnRemove ¶
func (episodes *AnimeEpisodes) OnRemove(ctx aero.Context, key string, index int, obj interface{})
OnRemove saves a log entry.
func (*AnimeEpisodes) Save ¶
func (episodes *AnimeEpisodes) Save()
Save saves the episodes in the database.
func (*AnimeEpisodes) Self ¶ added in v1.1.17
func (episodes *AnimeEpisodes) Self() Loggable
Self returns the object itself.
func (*AnimeEpisodes) Sort ¶
func (episodes *AnimeEpisodes) Sort()
Sort sorts the episodes by episode number.
func (*AnimeEpisodes) String ¶
func (episodes *AnimeEpisodes) String() string
String implements the default string serialization.
func (*AnimeEpisodes) TypeName ¶
func (episodes *AnimeEpisodes) TypeName() string
TypeName returns the type name.
type AnimeFinder ¶
type AnimeFinder struct {
// contains filtered or unexported fields
}
AnimeFinder holds an internal map of ID to anime mappings and is therefore very efficient to use when trying to find anime by a given service and ID.
func NewAnimeFinder ¶
func NewAnimeFinder(mappingName string) *AnimeFinder
NewAnimeFinder creates a new finder for external anime.
func (*AnimeFinder) GetAnime ¶
func (finder *AnimeFinder) GetAnime(id string) *Anime
GetAnime tries to find an external anime in our anime database.
type AnimeImage ¶
type AnimeImage struct { Extension string `json:"extension"` Width int `json:"width"` Height int `json:"height"` AverageColor HSLColor `json:"averageColor"` LastModified int64 `json:"lastModified"` }
AnimeImage ...
type AnimeList ¶
type AnimeList struct { UserID UserID `json:"userId"` Items []*AnimeListItem `json:"items"` sync.Mutex }
AnimeList is a list of anime list items.
func AllAnimeLists ¶
AllAnimeLists returns a slice of all anime.
func (*AnimeList) Authorize ¶
Authorize returns an error if the given API request is not authorized.
func (*AnimeList) FilterStatus ¶
FilterStatus ...
func (*AnimeList) Find ¶
func (list *AnimeList) Find(animeID string) *AnimeListItem
Find returns the list item with the specified anime ID, if available.
func (*AnimeList) Genres ¶
func (list *AnimeList) Genres() map[string][]*AnimeListItem
Genres returns a map of genre names mapped to the list items that belong to that genre.
func (*AnimeList) HasItemsWithStatus ¶
HasItemsWithStatus checks if the list contains an anime with the given status.
func (*AnimeList) Import ¶
func (list *AnimeList) Import(item *AnimeListItem)
Import adds an anime to the list if it hasn't been added yet and if it did exist it will update episode, rating and notes.
func (*AnimeList) NormalizeRatings ¶
func (list *AnimeList) NormalizeRatings()
NormalizeRatings normalizes all ratings so that they are perfectly stretched among the full scale.
func (*AnimeList) RemoveDuplicates ¶
func (list *AnimeList) RemoveDuplicates()
RemoveDuplicates removes duplicate entries.
func (*AnimeList) SortByRating ¶
func (list *AnimeList) SortByRating()
SortByRating sorts the anime list by overall rating.
func (*AnimeList) SplitByStatus ¶
SplitByStatus splits the anime list into multiple ones by status.
func (*AnimeList) Top ¶
func (list *AnimeList) Top(count int) []*AnimeListItem
Top returns the top entries.
func (*AnimeList) WithoutPrivateItems ¶
WithoutPrivateItems returns a new anime list with the private items removed.
type AnimeListItem ¶
type AnimeListItem struct { AnimeID string `json:"animeId"` Status string `json:"status" editable:"true"` Episodes int `json:"episodes" editable:"true"` Rating AnimeListItemRating `json:"rating"` Notes string `json:"notes" editable:"true"` RewatchCount int `json:"rewatchCount" editable:"true"` Private bool `json:"private" editable:"true"` Created string `json:"created"` Edited string `json:"edited"` }
AnimeListItem ...
func (*AnimeListItem) AfterEdit ¶
func (item *AnimeListItem) AfterEdit(ctx aero.Context) error
AfterEdit is called after the item is edited.
func (*AnimeListItem) Anime ¶
func (item *AnimeListItem) Anime() *Anime
Anime fetches the associated anime data.
func (*AnimeListItem) Edit ¶
func (item *AnimeListItem) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
Edit ...
func (*AnimeListItem) Link ¶
func (item *AnimeListItem) Link(userNick string) string
Link returns the URI for the given item.
func (*AnimeListItem) OnEpisodesChange ¶
func (item *AnimeListItem) OnEpisodesChange()
OnEpisodesChange is called when the watched episode count changes.
func (*AnimeListItem) OnStatusChange ¶
func (item *AnimeListItem) OnStatusChange()
OnStatusChange is called when the status changes.
func (*AnimeListItem) StatusHumanReadable ¶
func (item *AnimeListItem) StatusHumanReadable() string
StatusHumanReadable returns the human readable representation of the status.
type AnimeListItemRating ¶
type AnimeListItemRating struct { Overall float64 `json:"overall" editable:"true"` Story float64 `json:"story" editable:"true"` Visuals float64 `json:"visuals" editable:"true"` Soundtrack float64 `json:"soundtrack" editable:"true"` }
AnimeListItemRating ...
func (*AnimeListItemRating) IsNotRated ¶
func (rating *AnimeListItemRating) IsNotRated() bool
IsNotRated tells you whether all ratings are zero.
func (*AnimeListItemRating) Reset ¶
func (rating *AnimeListItemRating) Reset()
Reset sets all values to the default anime average rating.
type AnimePopularity ¶
type AnimePopularity struct { Watching int `json:"watching"` Completed int `json:"completed"` Planned int `json:"planned"` Hold int `json:"hold"` Dropped int `json:"dropped"` }
AnimePopularity shows how many users have that anime in a certain list.
func (*AnimePopularity) Total ¶
func (p *AnimePopularity) Total() int
Total returns the total number of users that added this anime to their collection.
type AnimeRating ¶
type AnimeRating struct { AnimeListItemRating // The amount of people who rated Count AnimeRatingCount `json:"count"` }
AnimeRating ...
type AnimeRatingCount ¶
type AnimeRatingCount struct { Overall int `json:"overall"` Story int `json:"story"` Visuals int `json:"visuals"` Soundtrack int `json:"soundtrack"` }
AnimeRatingCount ...
type AnimeRelation ¶
type AnimeRelation struct { AnimeID string `json:"animeId" editable:"true"` Type string `json:"type" editable:"true" datalist:"anime-relation-types"` }
AnimeRelation ...
func (*AnimeRelation) HumanReadableType ¶
func (relation *AnimeRelation) HumanReadableType() string
HumanReadableType ...
type AnimeRelations ¶
type AnimeRelations struct { AnimeID string `json:"animeId" mainID:"true"` Items []*AnimeRelation `json:"items" editable:"true"` sync.Mutex }
AnimeRelations is a list of relations for an anime.
func GetAnimeRelations ¶
func GetAnimeRelations(animeID string) (*AnimeRelations, error)
GetAnimeRelations ...
func (*AnimeRelations) Anime ¶
func (relations *AnimeRelations) Anime() *Anime
Anime returns the anime the relations list refers to.
func (*AnimeRelations) Authorize ¶
func (relations *AnimeRelations) Authorize(ctx aero.Context, action string) error
Authorize returns an error if the given API POST request is not authorized.
func (*AnimeRelations) Delete ¶
func (relations *AnimeRelations) Delete() error
Delete deletes the relation list from the database.
func (*AnimeRelations) Edit ¶
func (relations *AnimeRelations) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
Edit creates an edit log entry.
func (*AnimeRelations) Find ¶
func (relations *AnimeRelations) Find(animeID string) *AnimeRelation
Find returns the relation with the specified anime ID, if available.
func (*AnimeRelations) GetID ¶
func (relations *AnimeRelations) GetID() string
GetID returns the anime ID.
func (*AnimeRelations) Link ¶
func (relations *AnimeRelations) Link() string
Link returns the link for that object.
func (*AnimeRelations) OnAppend ¶
func (relations *AnimeRelations) OnAppend(ctx aero.Context, key string, index int, obj interface{})
OnAppend saves a log entry.
func (*AnimeRelations) OnRemove ¶
func (relations *AnimeRelations) OnRemove(ctx aero.Context, key string, index int, obj interface{})
OnRemove saves a log entry.
func (*AnimeRelations) Remove ¶
func (relations *AnimeRelations) Remove(animeID string) bool
Remove removes the anime ID from the relations.
func (*AnimeRelations) Save ¶
func (relations *AnimeRelations) Save()
Save saves the anime relations object in the database.
func (*AnimeRelations) Self ¶ added in v1.1.17
func (relations *AnimeRelations) Self() Loggable
Self returns the object itself.
func (*AnimeRelations) SortByStartDate ¶
func (relations *AnimeRelations) SortByStartDate()
SortByStartDate ...
func (*AnimeRelations) String ¶
func (relations *AnimeRelations) String() string
String implements the default string serialization.
func (*AnimeRelations) TypeName ¶
func (relations *AnimeRelations) TypeName() string
TypeName returns the type name.
type AnimeTitle ¶
type AnimeTitle struct { Canonical string `json:"canonical" editable:"true"` Romaji string `json:"romaji" editable:"true"` English string `json:"english" editable:"true"` Japanese string `json:"japanese" editable:"true"` Hiragana string `json:"hiragana" editable:"true"` Synonyms []string `json:"synonyms" editable:"true"` }
AnimeTitle ...
func (*AnimeTitle) ByUser ¶
func (title *AnimeTitle) ByUser(user *User) string
ByUser returns the preferred title for the given user.
type AvatarSettings ¶
type AvatarSettings struct { Source string `json:"source" editable:"true"` SourceURL string `json:"sourceUrl" editable:"true"` }
AvatarSettings ...
type CSSPosition ¶
CSSPosition ...
type CalendarSettings ¶ added in v1.1.5
type CalendarSettings struct {
ShowAddedAnimeOnly bool `json:"showAddedAnimeOnly" editable:"true"`
}
CalendarSettings ...
type Character ¶
type Character struct { Name CharacterName `json:"name" editable:"true"` Image CharacterImage `json:"image"` MainQuoteID string `json:"mainQuoteId" editable:"true"` Description string `json:"description" editable:"true" type:"textarea"` Spoilers []Spoiler `json:"spoilers" editable:"true"` Attributes []*CharacterAttribute `json:"attributes" editable:"true"` // contains filtered or unexported fields }
Character represents an anime or manga character.
func AllCharacters ¶
func AllCharacters() []*Character
AllCharacters returns a slice of all characters.
func FilterCharacters ¶
FilterCharacters filters all characters by a custom function.
func (*Character) AddPost ¶ added in v1.1.25
func (obj *Character) AddPost(postID string)
AddPost adds a post to the object.
func (*Character) Authorize ¶
Authorize returns an error if the given API request is not authorized.
func (*Character) AverageColor ¶
AverageColor returns the average color of the image.
func (*Character) CountLikes ¶ added in v1.1.25
func (obj *Character) CountLikes() int
CountLikes returns the number of likes the object has received.
func (*Character) CountPosts ¶ added in v1.1.25
func (obj *Character) CountPosts() int
CountPosts returns the number of posts written for this object.
func (*Character) Create ¶
Create sets the data for a new character with data we received from the API request.
func (*Character) Creator ¶ added in v1.1.25
func (obj *Character) Creator() *User
Creator returns the user who created this object.
func (*Character) CreatorID ¶ added in v1.1.25
func (obj *Character) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*Character) DeleteImages ¶
func (character *Character) DeleteImages()
DeleteImages deletes all images for the character.
func (*Character) DeleteInContext ¶
DeleteInContext deletes the character in the given context.
func (*Character) DownloadImage ¶
DownloadImage ...
func (*Character) Edit ¶
func (character *Character) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
Edit creates an edit log entry.
func (*Character) Editor ¶ added in v1.1.25
func (obj *Character) Editor() *User
Editor returns the user who last edited this object.
func (*Character) GetCreated ¶ added in v1.1.25
func (obj *Character) GetCreated() string
GetCreated returns the creation time of the object.
func (*Character) GetCreatedBy ¶ added in v1.1.25
func (obj *Character) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*Character) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*Character) GetID ¶ added in v1.1.25
func (obj *Character) GetID() string
GetID returns the ID.
func (*Character) GetIsDraft ¶ added in v1.1.25
func (obj *Character) GetIsDraft() bool
GetIsDraft tells you whether the object is a draft or not.
func (*Character) GetMapping ¶ added in v1.1.25
GetMapping returns the external ID for the given service.
func (*Character) Like ¶ added in v1.1.25
func (obj *Character) Like(userID UserID)
Like makes the given user ID like the object.
func (*Character) LikedBy ¶ added in v1.1.25
LikedBy checks to see if the user has liked the object.
func (*Character) Merge ¶
Merge deletes the character and moves all existing references to the new character.
func (*Character) Posts ¶ added in v1.1.25
func (obj *Character) Posts() []*Post
Posts returns a slice of all posts.
func (*Character) PostsRelevantFirst ¶ added in v1.1.25
PostsRelevantFirst returns a slice of all posts sorted by relevance.
func (*Character) RemoveMapping ¶ added in v1.1.25
RemoveMapping removes all mappings with the given service name and ID.
func (*Character) RemovePost ¶ added in v1.1.25
RemovePost removes a post from the object.
func (*Character) Save ¶
func (character *Character) Save()
Save saves the character in the database.
func (*Character) SetImage ¶
func (character *Character) SetImage(metaImage *imageserver.MetaImage) error
SetImage sets the character image to the given MetaImage.
func (*Character) SetImageBytes ¶
SetImageBytes accepts a byte buffer that represents an image file and updates the character image.
func (*Character) SetIsDraft ¶ added in v1.1.25
func (obj *Character) SetIsDraft(isDraft bool)
SetIsDraft sets the draft state for this object.
func (*Character) SetMapping ¶ added in v1.1.25
SetMapping sets the ID of an external site to the obj.
func (*Character) TitleByUser ¶
TitleByUser returns the preferred title for the given user.
type CharacterAttribute ¶
type CharacterAttribute struct { Name string `json:"name" editable:"true"` Value string `json:"value" editable:"true"` }
CharacterAttribute describes one attribute of a character, e.g. height or age.
type CharacterFinder ¶
type CharacterFinder struct {
// contains filtered or unexported fields
}
CharacterFinder holds an internal map of ID to anime mappings and is therefore very efficient to use when trying to find anime by a given service and ID.
func NewCharacterFinder ¶
func NewCharacterFinder(mappingName string) *CharacterFinder
NewCharacterFinder creates a new finder for external characters.
func (*CharacterFinder) Add ¶
func (finder *CharacterFinder) Add(character *Character)
Add adds a character to the search pool.
func (*CharacterFinder) GetCharacter ¶
func (finder *CharacterFinder) GetCharacter(id string) *Character
GetCharacter tries to find an external anime in our anime database.
type CharacterName ¶
type CharacterName struct { Canonical string `json:"canonical" editable:"true"` English string `json:"english" editable:"true"` Japanese string `json:"japanese" editable:"true"` Synonyms []string `json:"synonyms" editable:"true"` }
CharacterName ...
func (*CharacterName) ByUser ¶
func (name *CharacterName) ByUser(user *User) string
ByUser returns the preferred name for the given user.
type ClientErrorReport ¶
type ClientErrorReport struct { ID string `json:"id"` Message string `json:"message"` Stack string `json:"stack"` FileName string `json:"fileName"` LineNumber int `json:"lineNumber"` ColumnNumber int `json:"columnNumber"` // contains filtered or unexported fields }
ClientErrorReport saves JavaScript errors that happen in web clients like browsers.
func AllClientErrorReports ¶
func AllClientErrorReports() []*ClientErrorReport
AllClientErrorReports returns a slice of all characters.
func (*ClientErrorReport) Authorize ¶
func (report *ClientErrorReport) Authorize(ctx aero.Context, action string) error
Authorize returns an error if the given API request is not authorized.
func (*ClientErrorReport) Create ¶
func (report *ClientErrorReport) Create(ctx aero.Context) error
Create sets the data for a new report with data we received from the API request.
func (*ClientErrorReport) Creator ¶ added in v1.1.25
func (obj *ClientErrorReport) Creator() *User
Creator returns the user who created this object.
func (*ClientErrorReport) CreatorID ¶ added in v1.1.25
func (obj *ClientErrorReport) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*ClientErrorReport) GetCreated ¶ added in v1.1.25
func (obj *ClientErrorReport) GetCreated() string
GetCreated returns the creation time of the object.
func (*ClientErrorReport) GetCreatedBy ¶ added in v1.1.25
func (obj *ClientErrorReport) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*ClientErrorReport) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*ClientErrorReport) Save ¶
func (report *ClientErrorReport) Save()
Save saves the client error report in the database.
type Company ¶
type Company struct { Name CompanyName `json:"name" editable:"true"` Description string `json:"description" editable:"true" type:"textarea"` Email string `json:"email" editable:"true"` Links []*Link `json:"links" editable:"true"` // Other editable fields Location *Location `json:"location" editable:"true"` Tags []string `json:"tags" editable:"true"` // contains filtered or unexported fields }
Company represents an anime studio, producer or licensor.
func FilterCompanies ¶
FilterCompanies filters all companies by a custom function.
func (*Company) Anime ¶
func (company *Company) Anime() (studioAnime []*Anime, producedAnime []*Anime, licensedAnime []*Anime)
Anime returns the anime connected with this company.
func (*Company) CountLikes ¶ added in v1.1.25
func (obj *Company) CountLikes() int
CountLikes returns the number of likes the object has received.
func (*Company) Create ¶
Create sets the data for a new company with data we received from the API request.
func (*Company) Creator ¶ added in v1.1.25
func (obj *Company) Creator() *User
Creator returns the user who created this object.
func (*Company) CreatorID ¶ added in v1.1.25
func (obj *Company) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*Company) DeleteInContext ¶
DeleteInContext deletes the company in the given context.
func (*Company) Edit ¶
func (company *Company) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
Edit creates an edit log entry.
func (*Company) Editor ¶ added in v1.1.25
func (obj *Company) Editor() *User
Editor returns the user who last edited this object.
func (*Company) GetCreated ¶ added in v1.1.25
func (obj *Company) GetCreated() string
GetCreated returns the creation time of the object.
func (*Company) GetCreatedBy ¶ added in v1.1.25
func (obj *Company) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*Company) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*Company) GetIsDraft ¶ added in v1.1.25
func (obj *Company) GetIsDraft() bool
GetIsDraft tells you whether the object is a draft or not.
func (*Company) GetMapping ¶ added in v1.1.25
GetMapping returns the external ID for the given service.
func (*Company) Like ¶ added in v1.1.25
func (obj *Company) Like(userID UserID)
Like makes the given user ID like the object.
func (*Company) RemoveMapping ¶ added in v1.1.25
RemoveMapping removes all mappings with the given service name and ID.
func (*Company) SetIsDraft ¶ added in v1.1.25
func (obj *Company) SetIsDraft(isDraft bool)
SetIsDraft sets the draft state for this object.
func (*Company) SetMapping ¶ added in v1.1.25
SetMapping sets the ID of an external site to the obj.
type CompanyName ¶
type CompanyName struct { English string `json:"english" editable:"true"` Japanese string `json:"japanese" editable:"true"` Synonyms []string `json:"synonyms" editable:"true"` }
CompanyName ...
type ConnectionAnalytics ¶
type ConnectionAnalytics struct { DownLink float64 `json:"downLink"` RoundTripTime float64 `json:"roundTripTime"` EffectiveType string `json:"effectiveType"` }
ConnectionAnalytics stores information about connection speed and ping.
type DraftIndex ¶
type DraftIndex struct { UserID string `json:"userId"` GroupID string `json:"groupId"` SoundTrackID string `json:"soundTrackId"` CompanyID string `json:"companyId"` QuoteID string `json:"quoteId"` CharacterID string `json:"characterId"` AnimeID string `json:"animeId"` AMVID string `json:"amvId"` }
DraftIndex has references to unpublished drafts a user created.
type EditLogEntry ¶
type EditLogEntry struct { ID string `json:"id"` UserID string `json:"userId"` Action string `json:"action"` ObjectType string `json:"objectType"` // The typename of what was edited ObjectID string `json:"objectId"` // The ID of what was edited Key string `json:"key"` OldValue string `json:"oldValue"` NewValue string `json:"newValue"` Created string `json:"created"` }
EditLogEntry is an entry in the editor log.
func AllEditLogEntries ¶
func AllEditLogEntries() []*EditLogEntry
AllEditLogEntries returns a slice of all log entries.
func FilterEditLogEntries ¶
func FilterEditLogEntries(filter func(*EditLogEntry) bool) []*EditLogEntry
FilterEditLogEntries filters all log entries by a custom function.
func NewEditLogEntry ¶
func NewEditLogEntry(userID, action, objectType, objectID, key, oldValue, newValue string) *EditLogEntry
NewEditLogEntry ...
func (*EditLogEntry) ActionHumanReadable ¶
func (entry *EditLogEntry) ActionHumanReadable() string
ActionHumanReadable returns the human readable version of the action.
func (*EditLogEntry) EditorScore ¶
func (entry *EditLogEntry) EditorScore() int
EditorScore returns the editing score for this log entry.
func (*EditLogEntry) Object ¶
func (entry *EditLogEntry) Object() interface{}
Object returns the object the log entry refers to.
func (*EditLogEntry) Save ¶
func (entry *EditLogEntry) Save()
Save saves the log entry in the database.
func (*EditLogEntry) User ¶
func (entry *EditLogEntry) User() *User
User returns the user the log entry belongs to.
type EditorFilterSettings ¶
type EditorFilterSettings struct { Year string `json:"year" editable:"true"` Season string `json:"season" editable:"true"` Status string `json:"status" editable:"true"` Type string `json:"type" editable:"true"` }
EditorFilterSettings ...
func (*EditorFilterSettings) Suffix ¶
func (filter *EditorFilterSettings) Suffix() string
Suffix returns the URL suffix.
type EditorSettings ¶
type EditorSettings struct {
Filter EditorFilterSettings `json:"filter"`
}
EditorSettings ...
type EmailToUser ¶
EmailToUser stores the user ID for an email address.
type EpisodeTitle ¶
type EpisodeTitle struct { Romaji string `json:"romaji" editable:"true"` English string `json:"english" editable:"true"` Japanese string `json:"japanese" editable:"true"` }
EpisodeTitle ...
type ExternalMedia ¶
type ExternalMedia struct { Service string `json:"service" editable:"true" datalist:"media-services"` ServiceID string `json:"serviceId" editable:"true"` }
ExternalMedia ...
func GetYoutubeMedia ¶
func GetYoutubeMedia(url string) (*ExternalMedia, error)
GetYoutubeMedia returns an ExternalMedia object for the given Youtube link.
func (*ExternalMedia) Create ¶ added in v1.1.16
func (media *ExternalMedia) Create(ctx aero.Context) error
Create sets the data for new external media.
func (*ExternalMedia) EmbedLink ¶
func (media *ExternalMedia) EmbedLink() string
EmbedLink returns the embed link used in iframes for the given media.
type FacebookToUser ¶
type FacebookToUser GoogleToUser
FacebookToUser stores the user ID by Facebook user ID.
type FormatSettings ¶
type FormatSettings struct {
RatingsPrecision int `json:"ratingsPrecision" editable:"true"`
}
FormatSettings ...
type GeneralAnalytics ¶
type GeneralAnalytics struct {
TimezoneOffset int `json:"timezoneOffset"`
}
GeneralAnalytics stores general information.
type GoogleToUser ¶
GoogleToUser stores the user ID by Google user ID.
type Group ¶
type Group struct { Name string `json:"name" editable:"true"` Tagline string `json:"tagline" editable:"true"` Image GroupImage `json:"image"` Description string `json:"description" editable:"true" type:"textarea"` Rules string `json:"rules" editable:"true" type:"textarea"` Restricted bool `json:"restricted" editable:"true" tooltip:"Restricted groups can only be joined with the founder's permission."` Tags []string `json:"tags" editable:"true"` Members []*GroupMember `json:"members"` Neighbors []string `json:"neighbors"` // contains filtered or unexported fields }
Group represents a group of users.
func FilterGroups ¶
FilterGroups filters all groups by a custom function.
func (*Group) AddPost ¶ added in v1.1.25
func (obj *Group) AddPost(postID string)
AddPost adds a post to the object.
func (*Group) Authorize ¶
Authorize returns an error if the given API POST request is not authorized.
func (*Group) AverageColor ¶
AverageColor returns the average color of the image.
func (*Group) CountPosts ¶ added in v1.1.25
func (obj *Group) CountPosts() int
CountPosts returns the number of posts written for this object.
func (*Group) Creator ¶ added in v1.1.25
func (obj *Group) Creator() *User
Creator returns the user who created this object.
func (*Group) CreatorID ¶ added in v1.1.25
func (obj *Group) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*Group) DeleteImages ¶
func (group *Group) DeleteImages()
DeleteImages deletes all images for the group.
func (*Group) DeleteInContext ¶
DeleteInContext deletes the amv in the given context.
func (*Group) Edit ¶
func (group *Group) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
Edit creates an edit log entry.
func (*Group) Editor ¶ added in v1.1.25
func (obj *Group) Editor() *User
Editor returns the user who last edited this object.
func (*Group) FindMember ¶
func (group *Group) FindMember(userID UserID) *GroupMember
FindMember returns the group member by user ID, if available.
func (*Group) GetCreated ¶ added in v1.1.25
func (obj *Group) GetCreated() string
GetCreated returns the creation time of the object.
func (*Group) GetCreatedBy ¶ added in v1.1.25
func (obj *Group) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*Group) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*Group) GetIsDraft ¶ added in v1.1.25
func (obj *Group) GetIsDraft() bool
GetIsDraft tells you whether the object is a draft or not.
func (*Group) Posts ¶ added in v1.1.25
func (obj *Group) Posts() []*Post
Posts returns a slice of all posts.
func (*Group) PostsRelevantFirst ¶ added in v1.1.25
PostsRelevantFirst returns a slice of all posts sorted by relevance.
func (*Group) RemovePost ¶ added in v1.1.25
RemovePost removes a post from the object.
func (*Group) SendNotification ¶
func (group *Group) SendNotification(notification *PushNotification, excludeUserID UserID)
SendNotification sends a notification to all group members except for the excluded user ID.
func (*Group) SetImage ¶
func (group *Group) SetImage(metaImage *imageserver.MetaImage) error
SetImage sets the group image to the given MetaImage.
func (*Group) SetImageBytes ¶
SetImageBytes accepts a byte buffer that represents an image file and updates the group image.
func (*Group) SetIsDraft ¶ added in v1.1.25
func (obj *Group) SetIsDraft(isDraft bool)
SetIsDraft sets the draft state for this object.
func (*Group) TitleByUser ¶
TitleByUser returns the preferred title for the given user.
type GroupMember ¶
type GroupMember struct { UserID UserID `json:"userId"` Role string `json:"role"` Joined string `json:"joined"` // contains filtered or unexported fields }
GroupMember ...
type HSLColor ¶
type HSLColor struct { Hue float64 `json:"hue"` Saturation float64 `json:"saturation"` Lightness float64 `json:"lightness"` }
HSLColor ...
func GetAverageColor ¶
GetAverageColor returns the average color of an image in HSL format.
func (HSLColor) StringWithAlpha ¶
StringWithAlpha returns a representation like hsla(0, 0%, 0%, 0.5).
type IDCollection ¶
IDCollection ...
type IPInfoDBLocation ¶
type IPInfoDBLocation struct { CountryName string `json:"countryName"` CountryCode string `json:"countryCode"` Latitude string `json:"latitude"` Longitude string `json:"longitude"` CityName string `json:"cityName"` RegionName string `json:"regionName"` TimeZone string `json:"timeZone"` ZipCode string `json:"zipCode"` }
IPInfoDBLocation ...
type IgnoreAnimeDifference ¶
type IgnoreAnimeDifference struct { // The ID is built like this: arn:323|mal:356|JapaneseTitle ID string `json:"id"` ValueHash uint64 `json:"valueHash"` // contains filtered or unexported fields }
IgnoreAnimeDifference saves which differences between anime databases can be ignored.
func AllIgnoreAnimeDifferences ¶
func AllIgnoreAnimeDifferences() []*IgnoreAnimeDifference
AllIgnoreAnimeDifferences returns a slice of all ignored differences.
func FilterIgnoreAnimeDifferences ¶
func FilterIgnoreAnimeDifferences(filter func(*IgnoreAnimeDifference) bool) []*IgnoreAnimeDifference
FilterIgnoreAnimeDifferences filters all ignored differences by a custom function.
func GetIgnoreAnimeDifference ¶
func GetIgnoreAnimeDifference(id string) (*IgnoreAnimeDifference, error)
GetIgnoreAnimeDifference ...
func (*IgnoreAnimeDifference) Authorize ¶
func (ignore *IgnoreAnimeDifference) Authorize(ctx aero.Context, action string) error
Authorize returns an error if the given API POST request is not authorized.
func (*IgnoreAnimeDifference) Create ¶
func (ignore *IgnoreAnimeDifference) Create(ctx aero.Context) error
Create constructs the values for this new object with the data we received from the API request.
func (*IgnoreAnimeDifference) Creator ¶ added in v1.1.25
func (obj *IgnoreAnimeDifference) Creator() *User
Creator returns the user who created this object.
func (*IgnoreAnimeDifference) CreatorID ¶ added in v1.1.25
func (obj *IgnoreAnimeDifference) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*IgnoreAnimeDifference) GetCreated ¶ added in v1.1.25
func (obj *IgnoreAnimeDifference) GetCreated() string
GetCreated returns the creation time of the object.
func (*IgnoreAnimeDifference) GetCreatedBy ¶ added in v1.1.25
func (obj *IgnoreAnimeDifference) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*IgnoreAnimeDifference) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*IgnoreAnimeDifference) Save ¶
func (ignore *IgnoreAnimeDifference) Save()
Save saves the object in the database.
type Inventory ¶
type Inventory struct { UserID UserID `json:"userId"` Slots []*InventorySlot `json:"slots"` }
Inventory has inventory slots that store shop item IDs and their quantity.
func NewInventory ¶
NewInventory creates a new inventory with the default number of slots.
func (*Inventory) Authorize ¶
Authorize returns an error if the given API request is not authorized.
func (*Inventory) ContainsItem ¶
ContainsItem checks if the inventory contains the item ID already.
type InventorySlot ¶
InventorySlot ...
func (*InventorySlot) Decrease ¶
func (slot *InventorySlot) Decrease(count uint) error
Decrease reduces the quantity by the given number.
func (*InventorySlot) Increase ¶
func (slot *InventorySlot) Increase(count uint)
Increase increases the quantity by the given number.
type KitsuMatch ¶
type KitsuMatch struct { KitsuItem *kitsu.LibraryEntry `json:"kitsuItem"` ARNAnime *Anime `json:"arnAnime"` }
KitsuMatch ...
type LikeEventReceiver ¶
type LikeEventReceiver interface {
OnLike(user *User)
}
LikeEventReceiver ...
type Likeable ¶
type Likeable interface { Like(userID UserID) Unlike(userID UserID) LikedBy(userID UserID) bool CountLikes() int Link() string Save() }
Likeable ...
type Link ¶
type Link struct { Title string `json:"title" editable:"true"` URL string `json:"url" editable:"true"` }
Link describes a single link to an external website.
type Linkable ¶
type Linkable interface {
Link() string
}
Linkable defines an object that can be linked.
type ListProviderConfig ¶
type ListProviderConfig struct {
UserName string `json:"userName"`
}
ListProviderConfig ...
type Location ¶
type Location struct { CountryName string `json:"countryName"` CountryCode string `json:"countryCode"` Latitude float64 `json:"latitude" editable:"true"` Longitude float64 `json:"longitude" editable:"true"` CityName string `json:"cityName"` RegionName string `json:"regionName"` TimeZone string `json:"timeZone"` ZipCode string `json:"zipCode"` }
Location ...
func (*Location) Distance ¶
Distance calculates the distance in kilometers to the second location. Original implementation: https://www.movable-type.co.uk/scripts/latlong.html
type LockEventReceiver ¶
LockEventReceiver ...
type Mapping ¶
type Mapping struct { Service string `json:"service" editable:"true" datalist:"mapping-services"` ServiceID string `json:"serviceId" editable:"true"` }
Mapping ...
type MyAnimeListMatch ¶
type MyAnimeListMatch struct { MyAnimeListItem *mal.AnimeListItem `json:"malItem"` ARNAnime *Anime `json:"arnAnime"` }
MyAnimeListMatch ...
type Name ¶
type Name struct { First string `json:"first" editable:"true"` Last string `json:"last" editable:"true"` }
Name is the combination of a first and last name.
type NickToUser ¶
NickToUser stores the user ID by nickname.
type Notification ¶
type Notification struct { ID string `json:"id"` UserID string `json:"userId"` Created string `json:"created"` Seen string `json:"seen"` PushNotification }
Notification represents a user-associated notification.
func AllNotifications ¶
func AllNotifications() ([]*Notification, error)
AllNotifications returns a slice of all notifications.
func NewNotification ¶
func NewNotification(userID UserID, pushNotification *PushNotification) *Notification
NewNotification creates a new notification.
func (*Notification) CreatedTime ¶
func (notification *Notification) CreatedTime() time.Time
CreatedTime returns the created date as a time object.
func (*Notification) Save ¶
func (notification *Notification) Save()
Save saves the notification in the database.
func (*Notification) String ¶
func (notification *Notification) String() string
String returns a string representation of the notification.
func (*Notification) User ¶
func (notification *Notification) User() *User
User retrieves the user the notification was sent to.
type NotificationSettings ¶
type NotificationSettings struct { Email string `json:"email" private:"true"` NewFollowers bool `json:"newFollowers" editable:"true"` AnimeEpisodeReleases bool `json:"animeEpisodeReleases" editable:"true"` AnimeFinished bool `json:"animeFinished" editable:"true"` ForumLikes bool `json:"forumLikes" editable:"true"` GroupPostLikes bool `json:"groupPostLikes" editable:"true"` QuoteLikes bool `json:"quoteLikes" editable:"true"` SoundTrackLikes bool `json:"soundTrackLikes" editable:"true"` }
NotificationSettings ...
func DefaultNotificationSettings ¶
func DefaultNotificationSettings() NotificationSettings
DefaultNotificationSettings returns the default notification settings.
type PayPalPayment ¶
type PayPalPayment struct { ID string `json:"id"` UserID string `json:"userId"` PayerID string `json:"payerId"` Amount string `json:"amount"` Currency string `json:"currency"` Method string `json:"method"` Created string `json:"created"` }
PayPalPayment is an approved and exeucted PayPal payment.
func AllPayPalPayments ¶
func AllPayPalPayments() ([]*PayPalPayment, error)
AllPayPalPayments returns a slice of all paypal payments.
func FilterPayPalPayments ¶
func FilterPayPalPayments(filter func(*PayPalPayment) bool) ([]*PayPalPayment, error)
FilterPayPalPayments filters all paypal payments by a custom function.
func (*PayPalPayment) Gems ¶
func (payment *PayPalPayment) Gems() int
Gems returns the total amount of gems.
func (*PayPalPayment) Save ¶
func (payment *PayPalPayment) Save()
Save saves the paypal payment in the database.
func (*PayPalPayment) User ¶
func (payment *PayPalPayment) User() *User
User returns the user who made the payment.
type Person ¶
type Person struct { Name PersonName `json:"name" editable:"true"` Image PersonImage `json:"image"` // contains filtered or unexported fields }
Person represents a person in real life.
func FilterPersons ¶
FilterPersons filters all persons by a custom function.
func (*Person) AddPost ¶ added in v1.1.25
func (obj *Person) AddPost(postID string)
AddPost adds a post to the object.
func (*Person) CountLikes ¶ added in v1.1.25
func (obj *Person) CountLikes() int
CountLikes returns the number of likes the object has received.
func (*Person) CountPosts ¶ added in v1.1.25
func (obj *Person) CountPosts() int
CountPosts returns the number of posts written for this object.
func (*Person) Create ¶
Create sets the data for a new person with data we received from the API request.
func (*Person) Creator ¶ added in v1.1.25
func (obj *Person) Creator() *User
Creator returns the user who created this object.
func (*Person) CreatorID ¶ added in v1.1.25
func (obj *Person) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*Person) DeleteImages ¶
func (person *Person) DeleteImages()
DeleteImages deletes all images for the person.
func (*Person) DeleteInContext ¶
DeleteInContext deletes the person in the given context.
func (*Person) Edit ¶
func (person *Person) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
Edit creates an edit log entry.
func (*Person) Editor ¶ added in v1.1.25
func (obj *Person) Editor() *User
Editor returns the user who last edited this object.
func (*Person) GetCreated ¶ added in v1.1.25
func (obj *Person) GetCreated() string
GetCreated returns the creation time of the object.
func (*Person) GetCreatedBy ¶ added in v1.1.25
func (obj *Person) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*Person) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*Person) GetIsDraft ¶ added in v1.1.25
func (obj *Person) GetIsDraft() bool
GetIsDraft tells you whether the object is a draft or not.
func (*Person) Like ¶ added in v1.1.25
func (obj *Person) Like(userID UserID)
Like makes the given user ID like the object.
func (*Person) Posts ¶ added in v1.1.25
func (obj *Person) Posts() []*Post
Posts returns a slice of all posts.
func (*Person) PostsRelevantFirst ¶ added in v1.1.25
PostsRelevantFirst returns a slice of all posts sorted by relevance.
func (*Person) RemovePost ¶ added in v1.1.25
RemovePost removes a post from the object.
func (*Person) SetIsDraft ¶ added in v1.1.25
func (obj *Person) SetIsDraft(isDraft bool)
SetIsDraft sets the draft state for this object.
func (*Person) TitleByUser ¶
TitleByUser returns the preferred title for the given user.
type PersonName ¶
type PersonName struct { English Name `json:"english" editable:"true"` Japanese Name `json:"japanese" editable:"true"` }
PersonName represents the name of a person.
func (*PersonName) ByUser ¶
func (name *PersonName) ByUser(user *User) string
ByUser returns the preferred name for the given user.
func (*PersonName) String ¶
func (name *PersonName) String() string
String returns the default visualization of the name.
type PieChart ¶
type PieChart struct { Title string `json:"title"` Slices []*PieChartSlice `json:"slices"` }
PieChart ...
type PieChartSlice ¶
type PieChartSlice struct { From float64 `json:"from"` To float64 `json:"to"` Title string `json:"title"` Color string `json:"color"` }
PieChartSlice ...
func ToPieChartSlices ¶
func ToPieChartSlices(data map[string]float64) []*PieChartSlice
ToPieChartSlices ...
type Post ¶
type Post struct { Tags []string `json:"tags" editable:"true"` ParentID string `json:"parentId" editable:"true"` ParentType string `json:"parentType"` Edited string `json:"edited"` // contains filtered or unexported fields }
Post is a comment related to any parent type in the database.
func FilterPosts ¶
FilterPosts filters all forum posts by a custom function.
func FilterPostsWithUniqueThreads ¶
FilterPostsWithUniqueThreads removes posts with the same thread until we have enough posts.
func (*Post) AddPost ¶ added in v1.1.25
func (obj *Post) AddPost(postID string)
AddPost adds a post to the object.
func (*Post) Authorize ¶
Authorize returns an error if the given API POST request is not authorized.
func (*Post) CountLikes ¶ added in v1.1.25
func (obj *Post) CountLikes() int
CountLikes returns the number of likes the object has received.
func (*Post) CountPosts ¶ added in v1.1.25
func (obj *Post) CountPosts() int
CountPosts returns the number of posts written for this object.
func (*Post) Create ¶
Create sets the data for a new post with data we received from the API request.
func (*Post) Creator ¶ added in v1.1.25
func (obj *Post) Creator() *User
Creator returns the user who created this object.
func (*Post) CreatorID ¶ added in v1.1.25
func (obj *Post) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*Post) DeleteInContext ¶
DeleteInContext deletes the post in the given context.
func (*Post) Edit ¶
func (post *Post) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
Edit saves a log entry for the edit.
func (*Post) GetCreated ¶ added in v1.1.25
func (obj *Post) GetCreated() string
GetCreated returns the creation time of the object.
func (*Post) GetCreatedBy ¶ added in v1.1.25
func (obj *Post) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*Post) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*Post) GetParentID ¶
GetParentID returns the object ID of the parent.
func (*Post) GetText ¶ added in v1.1.25
func (obj *Post) GetText() string
GetText returns the text of the object.
func (*Post) Like ¶ added in v1.1.25
func (obj *Post) Like(userID UserID)
Like makes the given user ID like the object.
func (*Post) Parent ¶
func (post *Post) Parent() PostParent
Parent returns the object this post was posted in.
func (*Post) Posts ¶ added in v1.1.25
func (obj *Post) Posts() []*Post
Posts returns a slice of all posts.
func (*Post) PostsRelevantFirst ¶ added in v1.1.25
PostsRelevantFirst returns a slice of all posts sorted by relevance.
func (*Post) RemovePost ¶ added in v1.1.25
RemovePost removes a post from the object.
func (*Post) SetParent ¶
func (post *Post) SetParent(newParent PostParent)
SetParent sets a new parent.
func (*Post) TitleByUser ¶
TitleByUser returns the preferred title for the given user.
func (*Post) TopMostParent ¶
func (post *Post) TopMostParent() PostParent
TopMostParent returns the first non-post object this post was posted in.
type PostParent ¶
type PostParent interface { Linkable api.Savable GetID() string TypeName() string TitleByUser(*User) string Posts() []*Post PostsRelevantFirst(count int) []*Post CountPosts() int Creator() *User CreatorID() UserID AddPost(string) RemovePost(string) bool }
PostParent is an interface that defines common functions for parent objects of posts.
type Postable ¶
type Postable interface { Likeable TitleByUser(*User) string HTML() string Parent() PostParent Posts() []*Post CountPosts() int TypeName() string Creator() *User // Use Get prefix for these to avoid a // name clash with the internal fields. GetID() string GetText() string GetCreated() string GetParentID() string }
Postable is a generic interface for Threads, Posts and Messages.
func ToPostables ¶
func ToPostables(sliceOfPosts interface{}) []Postable
ToPostables converts a slice of specific types to a slice of generic postables.
type PrivacySettings ¶
type PrivacySettings struct { ShowAge bool `json:"showAge" editable:"true"` ShowGender bool `json:"showGender" editable:"true"` ShowLocation bool `json:"showLocation" editable:"true"` }
PrivacySettings ...
type Publishable ¶
type Publishable interface { Publish() error Unpublish() error Save() GetID() string GetCreatedBy() string GetIsDraft() bool SetIsDraft(bool) }
Publishable ...
type Purchase ¶
type Purchase struct { ID string `json:"id"` UserID string `json:"userId"` ItemID string `json:"itemId"` Quantity int `json:"quantity"` Price int `json:"price"` Currency string `json:"currency"` Date string `json:"date"` }
Purchase represents an item purchase by a user.
func AllPurchases ¶
AllPurchases returns a slice of all anime.
func FilterPurchases ¶
FilterPurchases filters all purchases by a custom function.
func NewPurchase ¶
NewPurchase creates a new Purchase object with a generated ID.
type PushEndpoint ¶
type PushEndpoint struct { Registered string `json:"registered"` Keys struct { P256DH string `json:"p256dh" private:"true"` Auth string `json:"auth" private:"true"` } `json:"keys"` }
PushEndpoint ...
type PushNotification ¶
type PushNotification struct { Title string `json:"title"` Message string `json:"message"` Icon string `json:"icon"` Link string `json:"link"` Type string `json:"type"` }
PushNotification represents a push notification.
type PushSubscription ¶
type PushSubscription struct { Platform string `json:"platform"` UserAgent string `json:"userAgent"` Screen struct { Width int `json:"width"` Height int `json:"height"` } `json:"screen"` Endpoint string `json:"endpoint" private:"true"` P256DH string `json:"p256dh" private:"true"` Auth string `json:"auth" private:"true"` Created string `json:"created"` LastSuccess string `json:"lastSuccess"` }
PushSubscription ...
func (*PushSubscription) SendNotification ¶
func (sub *PushSubscription) SendNotification(notification *PushNotification) (*http.Response, error)
SendNotification ...
type PushSubscriptions ¶
type PushSubscriptions struct { UserID UserID `json:"userId"` Items []*PushSubscription `json:"items"` }
PushSubscriptions is a list of push subscriptions made by a user.
func GetPushSubscriptions ¶
func GetPushSubscriptions(id string) (*PushSubscriptions, error)
GetPushSubscriptions ...
func (*PushSubscriptions) Add ¶
func (list *PushSubscriptions) Add(subscription *PushSubscription) error
Add adds a subscription to the list if it hasn't been added yet.
func (*PushSubscriptions) Authorize ¶
func (list *PushSubscriptions) Authorize(ctx aero.Context, action string) error
Authorize returns an error if the given API request is not authorized.
func (*PushSubscriptions) Contains ¶
func (list *PushSubscriptions) Contains(subscriptionID string) bool
Contains checks if the list contains the subscription ID already.
func (*PushSubscriptions) Filter ¶
func (list *PushSubscriptions) Filter()
Filter removes privacy critical fields from the settings object.
func (*PushSubscriptions) Find ¶
func (list *PushSubscriptions) Find(id string) *PushSubscription
Find returns the subscription with the specified ID, if available.
func (*PushSubscriptions) Remove ¶
func (list *PushSubscriptions) Remove(subscriptionID string) bool
Remove removes the subscription ID from the list.
func (*PushSubscriptions) Save ¶
func (list *PushSubscriptions) Save()
Save saves the push subscriptions in the database.
func (*PushSubscriptions) ShouldFilter ¶
func (list *PushSubscriptions) ShouldFilter(ctx aero.Context) bool
ShouldFilter tells whether data needs to be filtered in the given context.
type Quote ¶
type Quote struct { Text QuoteText `json:"text" editable:"true"` CharacterID string `json:"characterId" editable:"true"` AnimeID string `json:"animeId" editable:"true"` EpisodeNumber int `json:"episode" editable:"true"` Time int `json:"time" editable:"true"` // contains filtered or unexported fields }
Quote is a quote made by a character in an anime.
func FilterQuotes ¶
FilterQuotes filters all quotes by a custom function.
func (*Quote) AddPost ¶ added in v1.1.25
func (obj *Quote) AddPost(postID string)
AddPost adds a post to the object.
func (*Quote) CountLikes ¶ added in v1.1.25
func (obj *Quote) CountLikes() int
CountLikes returns the number of likes the object has received.
func (*Quote) CountPosts ¶ added in v1.1.25
func (obj *Quote) CountPosts() int
CountPosts returns the number of posts written for this object.
func (*Quote) Create ¶
Create sets the data for a new quote with data we received from the API request.
func (*Quote) Creator ¶ added in v1.1.25
func (obj *Quote) Creator() *User
Creator returns the user who created this object.
func (*Quote) CreatorID ¶ added in v1.1.25
func (obj *Quote) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*Quote) DeleteInContext ¶
DeleteInContext deletes the quote in the given context.
func (*Quote) Edit ¶
func (quote *Quote) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
Edit saves a log entry for the edit.
func (*Quote) Editor ¶ added in v1.1.25
func (obj *Quote) Editor() *User
Editor returns the user who last edited this object.
func (*Quote) GetCreated ¶ added in v1.1.25
func (obj *Quote) GetCreated() string
GetCreated returns the creation time of the object.
func (*Quote) GetCreatedBy ¶ added in v1.1.25
func (obj *Quote) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*Quote) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*Quote) GetIsDraft ¶ added in v1.1.25
func (obj *Quote) GetIsDraft() bool
GetIsDraft tells you whether the object is a draft or not.
func (*Quote) IsMainQuote ¶
IsMainQuote returns true if the quote is the main quote of the character.
func (*Quote) Like ¶ added in v1.1.25
func (obj *Quote) Like(userID UserID)
Like makes the given user ID like the object.
func (*Quote) Posts ¶ added in v1.1.25
func (obj *Quote) Posts() []*Post
Posts returns a slice of all posts.
func (*Quote) PostsRelevantFirst ¶ added in v1.1.25
PostsRelevantFirst returns a slice of all posts sorted by relevance.
func (*Quote) RemovePost ¶ added in v1.1.25
RemovePost removes a post from the object.
func (*Quote) SetIsDraft ¶ added in v1.1.25
func (obj *Quote) SetIsDraft(isDraft bool)
SetIsDraft sets the draft state for this object.
func (*Quote) TitleByUser ¶
TitleByUser returns the preferred title for the given user.
type QuoteText ¶
type QuoteText struct { English string `json:"english" editable:"true" type:"textarea"` Japanese string `json:"japanese" editable:"true" type:"textarea"` }
QuoteText ...
type ScreenAnalytics ¶
type ScreenAnalytics struct { Width int `json:"width"` Height int `json:"height"` AvailableWidth int `json:"availableWidth"` AvailableHeight int `json:"availableHeight"` PixelRatio float64 `json:"pixelRatio"` }
ScreenAnalytics stores information about the device screen.
type ServiceProviders ¶
type ServiceProviders struct {
Anime string `json:"anime"`
}
ServiceProviders ...
type Settings ¶
type Settings struct { UserID string `json:"userId"` SortBy string `json:"sortBy"` TitleLanguage string `json:"titleLanguage" editable:"true"` Providers ServiceProviders `json:"providers"` Avatar AvatarSettings `json:"avatar"` Format FormatSettings `json:"format"` Notification NotificationSettings `json:"notification"` Editor EditorSettings `json:"editor"` Privacy PrivacySettings `json:"privacy"` Calendar CalendarSettings `json:"calendar" editable:"true"` Theme string `json:"theme" editable:"true"` }
Settings represents user settings.
func (*Settings) Authorize ¶
Authorize returns an error if the given API POST request is not authorized.
func (*Settings) Edit ¶
func (settings *Settings) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
Edit updates the settings object.
func (*Settings) Filter ¶
func (settings *Settings) Filter()
Filter removes privacy critical fields from the settings object.
func (*Settings) ShouldFilter ¶
ShouldFilter tells whether data needs to be filtered in the given context.
type ShopItem ¶
type ShopItem struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Price uint `json:"price"` Icon string `json:"icon"` Rarity string `json:"rarity"` Order int `json:"order"` Consumable bool `json:"consumable"` }
ShopItem is a purchasable item in the shop.
func AllShopItems ¶
AllShopItems returns a slice of all items.
type SoundTrack ¶
type SoundTrack struct { Title SoundTrackTitle `json:"title" editable:"true"` Media []*ExternalMedia `json:"media" editable:"true"` Links []*Link `json:"links" editable:"true"` Lyrics SoundTrackLyrics `json:"lyrics" editable:"true"` Tags []string `` /* 702-byte string literal not displayed */ File string `json:"file"` // contains filtered or unexported fields }
SoundTrack is a soundtrack used in one or multiple anime.
func FilterSoundTracks ¶
func FilterSoundTracks(filter func(*SoundTrack) bool) []*SoundTrack
FilterSoundTracks filters all soundtracks by a custom function.
func (*SoundTrack) AddPost ¶ added in v1.1.25
func (obj *SoundTrack) AddPost(postID string)
AddPost adds a post to the object.
func (*SoundTrack) Anime ¶
func (track *SoundTrack) Anime() []*Anime
Anime fetches all tagged anime of the sound track.
func (*SoundTrack) Authorize ¶
func (track *SoundTrack) Authorize(ctx aero.Context, action string) error
Authorize returns an error if the given API POST request is not authorized.
func (*SoundTrack) CountLikes ¶ added in v1.1.25
func (obj *SoundTrack) CountLikes() int
CountLikes returns the number of likes the object has received.
func (*SoundTrack) CountPosts ¶ added in v1.1.25
func (obj *SoundTrack) CountPosts() int
CountPosts returns the number of posts written for this object.
func (*SoundTrack) Create ¶
func (track *SoundTrack) Create(ctx aero.Context) error
Create sets the data for a new track with data we received from the API request.
func (*SoundTrack) Creator ¶ added in v1.1.25
func (obj *SoundTrack) Creator() *User
Creator returns the user who created this object.
func (*SoundTrack) CreatorID ¶ added in v1.1.25
func (obj *SoundTrack) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*SoundTrack) Delete ¶
func (track *SoundTrack) Delete() error
Delete deletes the object from the database.
func (*SoundTrack) DeleteInContext ¶
func (track *SoundTrack) DeleteInContext(ctx aero.Context) error
DeleteInContext deletes the track in the given context.
func (*SoundTrack) Download ¶
func (track *SoundTrack) Download() error
Download downloads the track.
func (*SoundTrack) Edit ¶
func (track *SoundTrack) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
Edit updates the external media object.
func (*SoundTrack) EditedByUser ¶
func (track *SoundTrack) EditedByUser() *User
EditedByUser returns the user who edited this track last.
func (*SoundTrack) Editor ¶ added in v1.1.25
func (obj *SoundTrack) Editor() *User
Editor returns the user who last edited this object.
func (*SoundTrack) EtternaBeatmaps ¶
func (track *SoundTrack) EtternaBeatmaps() []string
EtternaBeatmaps returns all Etterna song IDs of the sound track.
func (*SoundTrack) GetCreated ¶ added in v1.1.25
func (obj *SoundTrack) GetCreated() string
GetCreated returns the creation time of the object.
func (*SoundTrack) GetCreatedBy ¶ added in v1.1.25
func (obj *SoundTrack) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*SoundTrack) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*SoundTrack) GetID ¶ added in v1.1.25
func (obj *SoundTrack) GetID() string
GetID returns the ID.
func (*SoundTrack) GetIsDraft ¶ added in v1.1.25
func (obj *SoundTrack) GetIsDraft() bool
GetIsDraft tells you whether the object is a draft or not.
func (*SoundTrack) HasLyrics ¶
func (track *SoundTrack) HasLyrics() bool
HasLyrics returns true if the track has lyrics in any language.
func (*SoundTrack) HasMediaByService ¶
func (track *SoundTrack) HasMediaByService(service string) bool
HasMediaByService returns true if the track has media by the given service.
func (*SoundTrack) HasTag ¶
func (track *SoundTrack) HasTag(search string) bool
HasTag returns true if it contains the given tag.
func (*SoundTrack) Like ¶ added in v1.1.25
func (obj *SoundTrack) Like(userID UserID)
Like makes the given user ID like the object.
func (*SoundTrack) LikedBy ¶ added in v1.1.25
LikedBy checks to see if the user has liked the object.
func (*SoundTrack) Link ¶
func (track *SoundTrack) Link() string
Link returns the permalink for the track.
func (*SoundTrack) MediaByService ¶
func (track *SoundTrack) MediaByService(service string) []*ExternalMedia
MediaByService returns a slice of all media by the given service.
func (*SoundTrack) OnAppend ¶
func (track *SoundTrack) OnAppend(ctx aero.Context, key string, index int, obj interface{})
OnAppend saves a log entry.
func (*SoundTrack) OnLike ¶
func (track *SoundTrack) OnLike(likedBy *User)
OnLike is called when the soundtrack receives a like.
func (*SoundTrack) OnRemove ¶
func (track *SoundTrack) OnRemove(ctx aero.Context, key string, index int, obj interface{})
OnRemove saves a log entry.
func (*SoundTrack) OsuBeatmaps ¶
func (track *SoundTrack) OsuBeatmaps() []string
OsuBeatmaps returns all osu beatmap IDs of the sound track.
func (*SoundTrack) Posts ¶ added in v1.1.25
func (obj *SoundTrack) Posts() []*Post
Posts returns a slice of all posts.
func (*SoundTrack) PostsRelevantFirst ¶ added in v1.1.25
PostsRelevantFirst returns a slice of all posts sorted by relevance.
func (*SoundTrack) RemovePost ¶ added in v1.1.25
RemovePost removes a post from the object.
func (*SoundTrack) Save ¶
func (track *SoundTrack) Save()
Save saves the soundtrack object in the database.
func (*SoundTrack) Self ¶ added in v1.1.17
func (track *SoundTrack) Self() Loggable
Self returns the object itself.
func (*SoundTrack) SetIsDraft ¶ added in v1.1.25
func (obj *SoundTrack) SetIsDraft(isDraft bool)
SetIsDraft sets the draft state for this object.
func (*SoundTrack) String ¶
func (track *SoundTrack) String() string
String implements the default string serialization.
func (*SoundTrack) TitleByUser ¶
func (track *SoundTrack) TitleByUser(user *User) string
TitleByUser returns the preferred title for the given user.
func (*SoundTrack) TypeName ¶
func (track *SoundTrack) TypeName() string
TypeName returns the type name.
type SoundTrackLyrics ¶
type SoundTrackLyrics struct { Romaji string `json:"romaji" editable:"true" type:"textarea"` Native string `json:"native" editable:"true" type:"textarea"` }
SoundTrackLyrics represents song lyrics.
type SoundTrackTitle ¶
type SoundTrackTitle struct { Canonical string `json:"canonical" editable:"true"` Native string `json:"native" editable:"true"` }
SoundTrackTitle represents a song title.
func (*SoundTrackTitle) ByUser ¶
func (title *SoundTrackTitle) ByUser(user *User) string
ByUser returns the preferred title for the given user.
func (*SoundTrackTitle) String ¶
func (title *SoundTrackTitle) String() string
String is the default representation of the title.
type Spoiler ¶
type Spoiler struct {
Text string `json:"text" editable:"true" type:"textarea"`
}
Spoiler represents a text that can spoil a future event.
type StatisticsCategory ¶
type StatisticsCategory struct { Name string `json:"name"` PieCharts []*PieChart `json:"pieCharts"` }
StatisticsCategory ...
type SystemAnalytics ¶
SystemAnalytics stores information about the CPU and OS.
type Thread ¶
type Thread struct { Title string `json:"title" editable:"true"` Sticky int `json:"sticky" editable:"true"` Tags []string `json:"tags" editable:"true"` Edited string `json:"edited"` // contains filtered or unexported fields }
Thread is a forum thread.
func (*Thread) AddPost ¶ added in v1.1.25
func (obj *Thread) AddPost(postID string)
AddPost adds a post to the object.
func (*Thread) Authorize ¶
Authorize returns an error if the given API POST request is not authorized.
func (*Thread) CountLikes ¶ added in v1.1.25
func (obj *Thread) CountLikes() int
CountLikes returns the number of likes the object has received.
func (*Thread) CountPosts ¶ added in v1.1.25
func (obj *Thread) CountPosts() int
CountPosts returns the number of posts written for this object.
func (*Thread) Create ¶
Create sets the data for a new thread with data we received from the API request.
func (*Thread) Creator ¶ added in v1.1.25
func (obj *Thread) Creator() *User
Creator returns the user who created this object.
func (*Thread) CreatorID ¶ added in v1.1.25
func (obj *Thread) CreatorID() UserID
CreatorID returns the ID of the user who created this object.
func (*Thread) DeleteInContext ¶
DeleteInContext deletes the thread in the given context.
func (*Thread) Edit ¶
func (thread *Thread) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error)
Edit creates an edit log entry.
func (*Thread) GetCreated ¶ added in v1.1.25
func (obj *Thread) GetCreated() string
GetCreated returns the creation time of the object.
func (*Thread) GetCreatedBy ¶ added in v1.1.25
func (obj *Thread) GetCreatedBy() UserID
GetCreatedBy returns the ID of the user who created this object.
func (*Thread) GetCreatedTime ¶ added in v1.1.25
GetCreatedTime returns the creation time of the object as a time struct.
func (*Thread) GetParentID ¶
GetParentID always returns an empty string for threads.
func (*Thread) GetText ¶ added in v1.1.25
func (obj *Thread) GetText() string
GetText returns the text of the object.
func (*Thread) IsLocked ¶ added in v1.1.25
func (obj *Thread) IsLocked() bool
IsLocked implements the Lockable interface.
func (*Thread) Like ¶ added in v1.1.25
func (obj *Thread) Like(userID UserID)
Like makes the given user ID like the object.
func (*Thread) Lock ¶ added in v1.1.25
func (obj *Thread) Lock(userID UserID)
Lock locks the object.
func (*Thread) Parent ¶
func (thread *Thread) Parent() PostParent
Parent always returns nil for threads.
func (*Thread) Posts ¶ added in v1.1.25
func (obj *Thread) Posts() []*Post
Posts returns a slice of all posts.
func (*Thread) PostsRelevantFirst ¶ added in v1.1.25
PostsRelevantFirst returns a slice of all posts sorted by relevance.
func (*Thread) RemovePost ¶ added in v1.1.25
RemovePost removes a post from the object.
func (*Thread) TitleByUser ¶
TitleByUser returns the title of the thread, regardless of the user language settings because threads are bound to one language.
type TwitterToUser ¶
type TwitterToUser GoogleToUser
TwitterToUser stores the user ID by Twitter user ID.
type UpcomingEpisode ¶
type UpcomingEpisode struct { Anime *Anime Episode *AnimeEpisode }
UpcomingEpisode is used in the user schedule.
type User ¶
type User struct { ID UserID `json:"id"` Nick string `json:"nick" editable:"true"` FirstName string `json:"firstName" private:"true"` LastName string `json:"lastName" private:"true"` Email string `json:"email" editable:"true" private:"true"` Role string `json:"role"` Registered string `json:"registered"` LastLogin string `json:"lastLogin" private:"true"` LastSeen string `json:"lastSeen" private:"true"` ProExpires string `json:"proExpires" editable:"true"` Gender string `json:"gender" editable:"true" private:"true" datalist:"genders"` Language string `json:"language"` Introduction string `json:"introduction" editable:"true" type:"textarea"` Website string `json:"website" editable:"true"` BirthDay string `json:"birthDay" editable:"true" private:"true"` IP string `json:"ip" private:"true"` UserAgent string `json:"agent" private:"true"` Balance int `json:"balance" private:"true"` Avatar UserAvatar `json:"avatar"` Cover UserCover `json:"cover"` Accounts UserAccounts `json:"accounts" private:"true"` Browser UserBrowser `json:"browser" private:"true"` OS UserOS `json:"os" private:"true"` Location *Location `json:"location" private:"true"` // contains filtered or unexported fields }
User is a registered person.
func FilterUsers ¶
FilterUsers filters all users by a custom function.
func GetUserByEmail ¶
GetUserByEmail fetches the user with the given email from the database.
func GetUserByFacebookID ¶
GetUserByFacebookID fetches the user with the given Facebook ID from the database.
func GetUserByGoogleID ¶
GetUserByGoogleID fetches the user with the given Google ID from the database.
func GetUserByNick ¶
GetUserByNick fetches the user with the given nick from the database.
func GetUserByTwitterID ¶
GetUserByTwitterID fetches the user with the given Twitter ID from the database.
func GetUserFromContext ¶
GetUserFromContext returns the logged in user for the given context.
func (*User) ActivateItemEffect ¶
ActivateItemEffect activates an item in the user inventory by the given item ID.
func (*User) AddEventStream ¶
func (user *User) AddEventStream(stream *aero.EventStream)
AddEventStream adds an event stream to the given user.
func (*User) AddPost ¶ added in v1.1.25
func (obj *User) AddPost(postID string)
AddPost adds a post to the object.
func (*User) AgeInYears ¶
AgeInYears returns the user's age in years.
func (*User) Authorize ¶
Authorize returns an error if the given API POST request is not authorized.
func (*User) AvatarLink ¶
AvatarLink returns the URL to the user avatar. Expects "small" (50 x 50) or "large" (560 x 560) for the size parameter.
func (*User) BroadcastEvent ¶
BroadcastEvent sends the given event to all event streams for the given user.
func (*User) CleanNick ¶
CleanNick only returns the nickname if it was set by user, otherwise empty string.
func (*User) ConnectFacebook ¶
ConnectFacebook connects the user's account with a Facebook account.
func (*User) ConnectGoogle ¶
ConnectGoogle connects the user's account with a Google account.
func (*User) ConnectTwitter ¶
ConnectTwitter connects the user's account with a Twitter account.
func (*User) CountPosts ¶ added in v1.1.25
func (obj *User) CountPosts() int
CountPosts returns the number of posts written for this object.
func (*User) Edit ¶
func (user *User) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (bool, error)
Edit updates the user object.
func (*User) EditorScore ¶
EditorScore returns the editor score.
func (*User) ExtendProDuration ¶
ExtendProDuration extends the PRO account duration by the given duration.
func (*User) Filter ¶
func (user *User) Filter()
Filter removes privacy critical fields from the user object.
func (*User) Follows ¶
func (user *User) Follows() *UserFollows
Follows returns the list of user follows.
func (*User) ForceSetNick ¶
ForceSetNick forces a nickname overwrite.
func (*User) HasBasicInfo ¶
HasBasicInfo returns true if the user has a username, an avatar and an introduction.
func (*User) LastActivityConsumeAnime ¶
func (user *User) LastActivityConsumeAnime(animeID string) *ActivityConsumeAnime
LastActivityConsumeAnime returns the last activity for the given anime.
func (*User) LastSeenTime ¶
LastSeenTime returns the time the user was last seen on the site.
func (*User) Notifications ¶
func (user *User) Notifications() *UserNotifications
Notifications returns the list of user notifications.
func (*User) Posts ¶ added in v1.1.25
func (obj *User) Posts() []*Post
Posts returns a slice of all posts.
func (*User) PostsRelevantFirst ¶ added in v1.1.25
PostsRelevantFirst returns a slice of all posts sorted by relevance.
func (*User) PushSubscriptions ¶
func (user *User) PushSubscriptions() *PushSubscriptions
PushSubscriptions ...
func (*User) RefreshFFXIVInfo ¶
RefreshFFXIVInfo refreshes a user's FFXIV information.
func (*User) RefreshOsuInfo ¶
RefreshOsuInfo refreshes a user's Osu information.
func (*User) RefreshOverwatchInfo ¶
RefreshOverwatchInfo refreshes a user's Overwatch information.
func (*User) RegisteredTime ¶
RegisteredTime returns the time the user registered his account.
func (*User) RemoveEventStream ¶
func (user *User) RemoveEventStream(stream *aero.EventStream) bool
RemoveEventStream removes an event stream from the given user and returns true if it was removed, otherwise false.
func (*User) RemovePost ¶ added in v1.1.25
RemovePost removes a post from the object.
func (*User) SendNotification ¶
func (user *User) SendNotification(pushNotification *PushNotification)
SendNotification accepts a PushNotification and generates a new Notification object. The notification is then sent to all registered push devices.
func (*User) SetAvatar ¶
func (user *User) SetAvatar(avatar *imageserver.MetaImage) error
SetAvatar sets the avatar to the given MetaImage.
func (*User) SetAvatarBytes ¶
SetAvatarBytes accepts a byte buffer that represents an image file and updates the avatar.
func (*User) SetCover ¶
func (user *User) SetCover(cover *imageserver.MetaImage) error
SetCover sets the cover image to the given MetaImage.
func (*User) SetCoverBytes ¶
SetCoverBytes accepts a byte buffer that represents an image file and updates the cover image.
func (*User) ShouldFilter ¶
ShouldFilter tells whether data needs to be filtered in the given context.
func (*User) SoundTracks ¶
func (user *User) SoundTracks() []*SoundTrack
SoundTracks returns the soundtracks posted by the user.
func (*User) TimeSinceRegistered ¶
TimeSinceRegistered returns the duration since the user registered his account.
func (*User) TitleByUser ¶
TitleByUser returns the username.
func (*User) WebsiteShortURL ¶
WebsiteShortURL returns the user website without the protocol.
func (*User) WebsiteURL ¶
WebsiteURL adds https:// to the URL.
type UserAccounts ¶
type UserAccounts struct { Facebook struct { ID string `json:"id" private:"true"` } `json:"facebook"` Google struct { ID string `json:"id" private:"true"` } `json:"google"` Twitter struct { ID string `json:"id" private:"true"` Nick string `json:"nick" private:"true"` } `json:"twitter"` Discord struct { Nick string `json:"nick" editable:"true"` Verified bool `json:"verified"` } `json:"discord"` Osu struct { Nick string `json:"nick" editable:"true"` PP float64 `json:"pp"` Accuracy float64 `json:"accuracy"` Level float64 `json:"level"` } `json:"osu"` Overwatch struct { BattleTag string `json:"battleTag" editable:"true"` SkillRating int `json:"skillRating"` Tier string `json:"tier"` } `json:"overwatch"` FinalFantasyXIV struct { Nick string `json:"nick" editable:"true"` Server string `json:"server" editable:"true" datalist:"ffxiv-servers"` Class string `json:"class"` Level int `json:"level"` ItemLevel int `json:"itemLevel"` } `json:"ffxiv"` AniList struct { Nick string `json:"nick" editable:"true"` } `json:"anilist"` AnimePlanet struct { Nick string `json:"nick" editable:"true"` } `json:"animeplanet"` MyAnimeList struct { Nick string `json:"nick" editable:"true"` } `json:"myanimelist"` Kitsu struct { Nick string `json:"nick" editable:"true"` } `json:"kitsu"` }
UserAccounts represents a user's accounts on external services.
type UserAvatar ¶
type UserAvatar struct { Extension string `json:"extension"` Source string `json:"source"` LastModified int64 `json:"lastModified"` }
UserAvatar ...
type UserBrowser ¶
type UserBrowser struct { Name string `json:"name" private:"true"` Version string `json:"version" private:"true"` IsMobile bool `json:"isMobile" private:"true"` }
UserBrowser ...
type UserCover ¶
type UserCover struct { Extension string `json:"extension"` LastModified int64 `json:"lastModified"` }
UserCover ...
type UserFollows ¶
UserFollows is a list including IDs to users you follow.
func AllUserFollows ¶
func AllUserFollows() ([]*UserFollows, error)
AllUserFollows returns a slice of all user follows.
func NewUserFollows ¶
func NewUserFollows(userID UserID) *UserFollows
NewUserFollows creates a new UserFollows list.
func (*UserFollows) Add ¶
func (list *UserFollows) Add(userID UserID) error
Add adds an user to the list if it hasn't been added yet.
func (*UserFollows) Authorize ¶
func (list *UserFollows) Authorize(ctx aero.Context, action string) error
Authorize returns an error if the given API request is not authorized.
func (*UserFollows) Contains ¶
func (list *UserFollows) Contains(userID UserID) bool
Contains checks if the list contains the user ID already.
func (*UserFollows) Remove ¶
func (list *UserFollows) Remove(userID UserID) bool
Remove removes the user ID from the list.
func (*UserFollows) Save ¶
func (list *UserFollows) Save()
Save saves the follow list in the database.
func (*UserFollows) Users ¶
func (list *UserFollows) Users() []*User
Users returns a slice of all the users you are following.
func (*UserFollows) UsersWhoFollowBack ¶
func (list *UserFollows) UsersWhoFollowBack() []*User
UsersWhoFollowBack returns a slice of all the users you are following that also follow you.
type UserListProviders ¶
type UserListProviders struct { AniList ListProviderConfig `json:"AniList"` AnimePlanet ListProviderConfig `json:"AnimePlanet"` HummingBird ListProviderConfig `json:"HummingBird"` MyAnimeList ListProviderConfig `json:"MyAnimeList"` }
UserListProviders ...
type UserNotifications ¶
UserNotifications is a list including IDs to your notifications.
func AllUserNotifications ¶
func AllUserNotifications() ([]*UserNotifications, error)
AllUserNotifications returns a slice of all user notifications.
func GetUserNotifications ¶
func GetUserNotifications(id UserID) (*UserNotifications, error)
GetUserNotifications ...
func NewUserNotifications ¶
func NewUserNotifications(userID UserID) *UserNotifications
NewUserNotifications creates a new UserNotifications list.
func (*UserNotifications) Add ¶
func (list *UserNotifications) Add(notificationID string) error
Add adds an user to the list if it hasn't been added yet.
func (*UserNotifications) Contains ¶
func (list *UserNotifications) Contains(notificationID string) bool
Contains checks if the list contains the notification ID already.
func (*UserNotifications) CountUnseen ¶
func (list *UserNotifications) CountUnseen() int
CountUnseen returns the number of unseen notifications.
func (*UserNotifications) Notifications ¶
func (list *UserNotifications) Notifications() []*Notification
Notifications returns a slice of all the notifications.
func (*UserNotifications) Remove ¶
func (list *UserNotifications) Remove(notificationID string) bool
Remove removes the notification ID from the list.
func (*UserNotifications) Save ¶
func (list *UserNotifications) Save()
Save saves the notification list in the database.
Source Files ¶
- AMV.go
- AMVAPI.go
- AMVTitle.go
- APIKeys.go
- Activity.go
- ActivityConsumeAnime.go
- ActivityConsumeAnimeAPI.go
- ActivityCreate.go
- ActivityCreateAPI.go
- AiringDate.go
- Analytics.go
- AnalyticsAPI.go
- AniList.go
- AniListMatch.go
- Anime.go
- AnimeAPI.go
- AnimeCharacter.go
- AnimeCharacterAPI.go
- AnimeCharacters.go
- AnimeCharactersAPI.go
- AnimeEpisode.go
- AnimeEpisodes.go
- AnimeEpisodesAPI.go
- AnimeFinder.go
- AnimeImage.go
- AnimeList.go
- AnimeListAPI.go
- AnimeListItem.go
- AnimeListItemAPI.go
- AnimeListItemRating.go
- AnimePopularity.go
- AnimeRating.go
- AnimeRelation.go
- AnimeRelations.go
- AnimeRelationsAPI.go
- AnimeSort.go
- AnimeTitle.go
- AuthorizeHelper.go
- Avatar.go
- Bot.go
- Character.go
- CharacterAPI.go
- CharacterAttribute.go
- CharacterFinder.go
- CharacterImage.go
- CharacterName.go
- ClientErrorReport.go
- ClientErrorReportAPI.go
- CollectionUtils.go
- Company.go
- CompanyAPI.go
- CompanyName.go
- CompanySort.go
- DataLists.go
- Database.go
- DraftIndex.go
- DraftIndexAPI.go
- Draftable.go
- EditLogEntry.go
- EditLogEntryAPI.go
- EmailToUser.go
- ExternalMedia.go
- ExternalMediaAPI.go
- FacebookToUser.go
- ForumIcons.go
- Genres.go
- GoogleToUser.go
- Group.go
- GroupAPI.go
- GroupImage.go
- GroupMember.go
- HSLColor.go
- HasCreator.go
- HasDraft.go
- HasEditing.go
- HasEditor.go
- HasID.go
- HasLikes.go
- HasLocked.go
- HasMappings.go
- HasPosts.go
- HasText.go
- IDCollection.go
- IDList.go
- IgnoreAnimeDifference.go
- IgnoreAnimeDifferenceAPI.go
- Inventory.go
- InventoryAPI.go
- InventorySlot.go
- JapaneseTokenizer.go
- Joinable.go
- KitsuAnime.go
- KitsuMappings.go
- KitsuMatch.go
- Likeable.go
- Link.go
- Linkable.go
- ListOfMappedIDs.go
- Location.go
- Lockable.go
- Loggable.go
- Mapping.go
- MyAnimeListMatch.go
- Name.go
- NickToUser.go
- Notification.go
- NotificationAPI.go
- NotificationType.go
- Nyaa.go
- OpenGraph.go
- PayPal.go
- PayPalPayment.go
- Person.go
- PersonAPI.go
- PersonImage.go
- PersonName.go
- Post.go
- PostAPI.go
- PostParent.go
- Postable.go
- Production.go
- Publishable.go
- Purchase.go
- PurchaseAPI.go
- PushNotification.go
- PushSubscription.go
- PushSubscriptions.go
- PushSubscriptionsAPI.go
- Quote.go
- QuoteAPI.go
- QuoteText.go
- Session.go
- Settings.go
- SettingsAPI.go
- ShopItem.go
- ShopItemAPI.go
- SoundTrack.go
- SoundTrackAPI.go
- SoundTrackLyrics.go
- SoundTrackTitle.go
- SoundTrackUtils.go
- Spoiler.go
- StatisticsCategory.go
- StatisticsItem.go
- Thread.go
- ThreadAPI.go
- TwitterToUser.go
- UpcomingEpisode.go
- User.go
- UserAPI.go
- UserAccounts.go
- UserAvatar.go
- UserConnectAccounts.go
- UserCover.go
- UserEvents.go
- UserFollows.go
- UserFollowsAPI.go
- UserHelper.go
- UserJoins.go
- UserNotifications.go
- UserNotificationsAPI.go
- UserSubTypes.go
- Utils.go