Documentation
¶
Index ¶
- Variables
- func ArtworkStatusNames() []string
- func PermissionNames() []string
- func R18TypeNames() []string
- func SourceTypeNames() []string
- func StorageTypeNames() []string
- func TelegramMediaTypeNames() []string
- type ArtistLike
- type ArtworkLike
- type ArtworkStatus
- type MediaLike
- type Permission
- type PictureLike
- type R18Type
- type SourceType
- type StorageDetail
- type StorageInfo
- type StorageType
- type TelegramInfo
- func (t *TelegramInfo) ClearFileIDs()
- func (t TelegramInfo) DocumentFileID(botID int64) string
- func (t TelegramInfo) FileID(botID int64, mediaType TelegramMediaType) string
- func (t TelegramInfo) IsZero() bool
- func (t *TelegramInfo) MergeFrom(other *TelegramInfo)
- func (t TelegramInfo) MessageID(chatID int64) int
- func (t TelegramInfo) PhotoFileID(botID int64) string
- func (t *TelegramInfo) SetFileID(botID int64, mediaType TelegramMediaType, fileID string)
- func (t *TelegramInfo) SetMessage(chatID int64, messageID int, mediaGroupID string)
- func (t TelegramInfo) VideoFileID(botID int64) string
- type TelegramMediaType
- type TelegramMessage
- type UgoiraFrame
- type UgoiraMetaData
- type UgoiraMetaLike
- type VideoLike
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidArtworkStatus = fmt.Errorf("not a valid ArtworkStatus, try [%s]", strings.Join(_ArtworkStatusNames, ", "))
var ErrInvalidPermission = fmt.Errorf("not a valid Permission, try [%s]", strings.Join(_PermissionNames, ", "))
var ErrInvalidR18Type = fmt.Errorf("not a valid R18Type, try [%s]", strings.Join(_R18TypeNames, ", "))
var ErrInvalidSourceType = fmt.Errorf("not a valid SourceType, try [%s]", strings.Join(_SourceTypeNames, ", "))
var ErrInvalidStorageType = fmt.Errorf("not a valid StorageType, try [%s]", strings.Join(_StorageTypeNames, ", "))
var ErrInvalidTelegramMediaType = fmt.Errorf("not a valid TelegramMediaType, try [%s]", strings.Join(_TelegramMediaTypeNames, ", "))
var ZeroStorageDetail = StorageDetail{}
var ZeroStorageInfo = StorageInfo{}
var ZeroUgoiraMetaData = UgoiraMetaData{}
Functions ¶
func ArtworkStatusNames ¶
func ArtworkStatusNames() []string
ArtworkStatusNames returns a list of possible string values of ArtworkStatus.
func PermissionNames ¶
func PermissionNames() []string
PermissionNames returns a list of possible string values of Permission.
func R18TypeNames ¶
func R18TypeNames() []string
R18TypeNames returns a list of possible string values of R18Type.
func SourceTypeNames ¶
func SourceTypeNames() []string
SourceTypeNames returns a list of possible string values of SourceType.
func StorageTypeNames ¶
func StorageTypeNames() []string
StorageTypeNames returns a list of possible string values of StorageType.
func TelegramMediaTypeNames ¶
func TelegramMediaTypeNames() []string
TelegramMediaTypeNames returns a list of possible string values of TelegramMediaType.
Types ¶
type ArtistLike ¶
type ArtworkLike ¶
type ArtworkLike interface {
GetID() string
GetSourceURL() string
GetTitle() string
GetR18() bool
GetArtist() ArtistLike
GetDescription() string
GetTags() []string
MediasCount() int
GetType() SourceType
FirstMedia() MediaLike
GetPictures() []PictureLike
GetUgoiraMetas() []UgoiraMetaLike
GetVideos() []VideoLike
}
type ArtworkStatus ¶
type ArtworkStatus string
ArtworkStatus
ENUM( cached posting posted )
const ( // ArtworkStatusCached is a ArtworkStatus of type cached. ArtworkStatusCached ArtworkStatus = "cached" // ArtworkStatusPosting is a ArtworkStatus of type posting. ArtworkStatusPosting ArtworkStatus = "posting" // ArtworkStatusPosted is a ArtworkStatus of type posted. ArtworkStatusPosted ArtworkStatus = "posted" )
func ArtworkStatusValues ¶
func ArtworkStatusValues() []ArtworkStatus
ArtworkStatusValues returns a list of the values for ArtworkStatus
func ParseArtworkStatus ¶
func ParseArtworkStatus(name string) (ArtworkStatus, error)
ParseArtworkStatus attempts to convert a string to a ArtworkStatus.
func (ArtworkStatus) IsValid ¶
func (x ArtworkStatus) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ArtworkStatus) String ¶
func (x ArtworkStatus) String() string
String implements the Stringer interface.
type MediaLike ¶ added in v1.5.0
type MediaLike interface {
GetIndex() uint
GetTelegramInfo() TelegramInfo
}
type Permission ¶
type Permission string
Permission
ENUM( sudo post_artwork delete_artwork get_artwork_info edit_artwork fetch_artwork send_artwork_info )
const ( // PermissionSudo is a Permission of type sudo. PermissionSudo Permission = "sudo" // PermissionPostArtwork is a Permission of type post_artwork. PermissionPostArtwork Permission = "post_artwork" // PermissionDeleteArtwork is a Permission of type delete_artwork. PermissionDeleteArtwork Permission = "delete_artwork" // PermissionGetArtworkInfo is a Permission of type get_artwork_info. PermissionGetArtworkInfo Permission = "get_artwork_info" // PermissionEditArtwork is a Permission of type edit_artwork. PermissionEditArtwork Permission = "edit_artwork" // PermissionFetchArtwork is a Permission of type fetch_artwork. PermissionFetchArtwork Permission = "fetch_artwork" // PermissionSendArtworkInfo is a Permission of type send_artwork_info. PermissionSendArtworkInfo Permission = "send_artwork_info" )
func ParsePermission ¶
func ParsePermission(name string) (Permission, error)
ParsePermission attempts to convert a string to a Permission.
func PermissionValues ¶
func PermissionValues() []Permission
PermissionValues returns a list of the values for Permission
func (Permission) IsValid ¶
func (x Permission) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (Permission) String ¶
func (x Permission) String() string
String implements the Stringer interface.
type PictureLike ¶
type PictureLike interface {
IsHide() bool
GetIndex() uint
GetTelegramInfo() TelegramInfo
GetOriginal() string
GetThumbnail() string
GetSize() (width, height uint)
GetStorageInfo() StorageInfo
}
type R18Type ¶
type R18Type uint
R18Type
ENUM( none r18 all )
func ParseR18Type ¶
ParseR18Type attempts to convert a string to a R18Type.
func R18TypeFromInt ¶
func R18TypeValues ¶
func R18TypeValues() []R18Type
R18TypeValues returns a list of the values for R18Type
type SourceType ¶
type SourceType string
SourceType
ENUM( pixiv twitter bilibili danbooru kemono yandere nhentai )
const ( // SourceTypePixiv is a SourceType of type pixiv. SourceTypePixiv SourceType = "pixiv" // SourceTypeTwitter is a SourceType of type twitter. SourceTypeTwitter SourceType = "twitter" // SourceTypeBilibili is a SourceType of type bilibili. SourceTypeBilibili SourceType = "bilibili" // SourceTypeDanbooru is a SourceType of type danbooru. SourceTypeDanbooru SourceType = "danbooru" // SourceTypeKemono is a SourceType of type kemono. SourceTypeKemono SourceType = "kemono" // SourceTypeYandere is a SourceType of type yandere. SourceTypeYandere SourceType = "yandere" // SourceTypeNhentai is a SourceType of type nhentai. SourceTypeNhentai SourceType = "nhentai" )
func ParseSourceType ¶
func ParseSourceType(name string) (SourceType, error)
ParseSourceType attempts to convert a string to a SourceType.
func SourceTypeValues ¶
func SourceTypeValues() []SourceType
SourceTypeValues returns a list of the values for SourceType
func (SourceType) IsValid ¶
func (x SourceType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (SourceType) String ¶
func (x SourceType) String() string
String implements the Stringer interface.
type StorageDetail ¶
type StorageDetail struct {
Type StorageType `json:"type"`
Path string `json:"path"`
Mime string `json:"mime,omitempty"`
}
func (StorageDetail) Hash ¶
func (s StorageDetail) Hash() string
func (StorageDetail) IsZero ¶
func (s StorageDetail) IsZero() bool
type StorageInfo ¶
type StorageInfo struct {
Original *StorageDetail `json:"original"`
Regular *StorageDetail `json:"regular"`
Thumb *StorageDetail `json:"thumb"`
}
func (StorageInfo) IsZero ¶
func (s StorageInfo) IsZero() bool
type StorageType ¶
type StorageType string
StorageType
ENUM( webdav local alist telegram )
const ( // StorageTypeWebdav is a StorageType of type webdav. StorageTypeWebdav StorageType = "webdav" // StorageTypeLocal is a StorageType of type local. StorageTypeLocal StorageType = "local" // StorageTypeAlist is a StorageType of type alist. StorageTypeAlist StorageType = "alist" // StorageTypeTelegram is a StorageType of type telegram. StorageTypeTelegram StorageType = "telegram" )
func ParseStorageType ¶
func ParseStorageType(name string) (StorageType, error)
ParseStorageType attempts to convert a string to a StorageType.
func StorageTypeValues ¶
func StorageTypeValues() []StorageType
StorageTypeValues returns a list of the values for StorageType
func (StorageType) IsValid ¶
func (x StorageType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (StorageType) String ¶
func (x StorageType) String() string
String implements the Stringer interface.
type TelegramInfo ¶
type TelegramInfo struct {
// {bot_id:{"photo": file_id, "document": file_id}}
FileIDs map[int64]map[TelegramMediaType]string `json:"file_ids"` // (file_id is bot specific)
Messages map[int64]TelegramMessage `json:"messages"` // key: chat id
}
func (*TelegramInfo) ClearFileIDs ¶
func (t *TelegramInfo) ClearFileIDs()
func (TelegramInfo) DocumentFileID ¶
func (t TelegramInfo) DocumentFileID(botID int64) string
func (TelegramInfo) FileID ¶
func (t TelegramInfo) FileID(botID int64, mediaType TelegramMediaType) string
func (TelegramInfo) IsZero ¶
func (t TelegramInfo) IsZero() bool
func (*TelegramInfo) MergeFrom ¶
func (t *TelegramInfo) MergeFrom(other *TelegramInfo)
func (TelegramInfo) MessageID ¶
func (t TelegramInfo) MessageID(chatID int64) int
func (TelegramInfo) PhotoFileID ¶
func (t TelegramInfo) PhotoFileID(botID int64) string
func (*TelegramInfo) SetFileID ¶
func (t *TelegramInfo) SetFileID(botID int64, mediaType TelegramMediaType, fileID string)
func (*TelegramInfo) SetMessage ¶
func (t *TelegramInfo) SetMessage(chatID int64, messageID int, mediaGroupID string)
func (TelegramInfo) VideoFileID ¶
func (t TelegramInfo) VideoFileID(botID int64) string
type TelegramMediaType ¶
type TelegramMediaType string
TelegramMediaType
ENUM( photo document video )
const ( // TelegramMediaTypePhoto is a TelegramMediaType of type photo. TelegramMediaTypePhoto TelegramMediaType = "photo" // TelegramMediaTypeDocument is a TelegramMediaType of type document. TelegramMediaTypeDocument TelegramMediaType = "document" // TelegramMediaTypeVideo is a TelegramMediaType of type video. TelegramMediaTypeVideo TelegramMediaType = "video" )
func ParseTelegramMediaType ¶
func ParseTelegramMediaType(name string) (TelegramMediaType, error)
ParseTelegramMediaType attempts to convert a string to a TelegramMediaType.
func TelegramMediaTypeValues ¶
func TelegramMediaTypeValues() []TelegramMediaType
TelegramMediaTypeValues returns a list of the values for TelegramMediaType
func (TelegramMediaType) IsValid ¶
func (x TelegramMediaType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (TelegramMediaType) String ¶
func (x TelegramMediaType) String() string
String implements the Stringer interface.
type TelegramMessage ¶
type UgoiraFrame ¶
type UgoiraMetaData ¶
type UgoiraMetaData struct {
// PosterOriginal is the original poster image URL.
PosterOriginal string `json:"poster_original"`
PosterThumb string `json:"poster_thumb"`
// OriginalZip is the original ugoira zip URL.
//
// The zip should be pixiv's ugoira zip style
OriginalZip string `json:"original_zip"`
ThumbZip string `json:"thumb_zip"`
MimeType string `json:"mime_type"`
Frames []UgoiraFrame `json:"frames"`
Width int `json:"width"`
Height int `json:"height"`
}
type UgoiraMetaLike ¶
type UgoiraMetaLike interface {
GetIndex() uint
GetData() UgoiraMetaData
GetOriginalStorage() StorageDetail
GetTelegramInfo() TelegramInfo
}