Documentation ¶
Index ¶
- type APIKey
- type APIRepo
- type Category
- type Chapter
- type Config
- type ConfigUpdate
- type History
- type Manga
- type MangaData
- type MangaDataRepo
- type Notification
- type NotificationEvent
- type NotificationEventArr
- type NotificationPayload
- type NotificationQueryParams
- type NotificationRepo
- type NotificationSender
- type NotificationType
- type Sources
- type Sync
- type SyncData
- type SyncLockFile
- type SyncRepo
- type SyncStatus
- type Tracking
- type User
- type UserRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chapter ¶
type Chapter struct { URL string `json:"url"` Name string `json:"name"` Scanlator string `json:"scanlator"` Read bool `json:"read"` Bookmark bool `json:"bookmark"` LastPageRead int64 `json:"lastPageRead"` DateFetch int64 `json:"dateFetch"` DateUpload int64 `json:"dateUpload"` ChapterNumber float64 `json:"chapterNumber"` SourceOrder int `json:"sourceOrder"` LastModifiedAt int64 `json:"lastModifiedAt"` }
type Config ¶
type Config struct { Version string ConfigPath string Host string `toml:"host"` Port int `toml:"port"` LogLevel string `toml:"logLevel"` LogPath string `toml:"logPath"` LogMaxSize int `toml:"logMaxSize"` LogMaxBackups int `toml:"logMaxBackups"` BaseURL string `toml:"baseUrl"` SessionSecret string `toml:"sessionSecret"` CheckForUpdates bool `toml:"checkForUpdates"` DatabaseType string `toml:"databaseType"` PostgresHost string `toml:"postgresHost"` PostgresPort int `toml:"postgresPort"` PostgresDatabase string `toml:"postgresDatabase"` PostgresUser string `toml:"postgresUser"` PostgresPass string `toml:"postgresPass"` }
type ConfigUpdate ¶
type Manga ¶
type Manga struct { Source int64 `json:"source"` URL string `json:"url"` Title string `json:"title"` Artist string `json:"artist"` Author string `json:"author"` Description string `json:"description"` Genre []string `json:"genre"` Status int `json:"status"` ThumbnailURL string `json:"thumbnailUrl"` DateAdded int64 `json:"dateAdded"` Viewer int `json:"viewer"` Chapters []Chapter `json:"chapters"` Tracking []Tracking `json:"tracking"` Favorite bool `json:"favorite"` Categories []int `json:"categories"` ViewerFlags int `json:"viewer_flags"` History []History `json:"history"` LastModifiedAt int64 `json:"lastModifiedAt"` }
type MangaData ¶
type MangaData struct { ID int `json:"id"` BackupManga []Manga `json:"backupManga"` BackupCategories []Category `json:"backupCategories"` BackupBrokenSources []interface{} `json:"backupBrokenSources"` BackupSources []Sources `json:"backupSources"` BackupPreferences []interface{} `json:"backupPreferences"` BackupSourcePreferences []interface{} `json:"backupSourcePreferences"` UserApiKey *APIKey `json:"user_api_key,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type MangaDataRepo ¶
type MangaDataRepo interface { Store(ctx context.Context, mdata *MangaData) (*MangaData, error) Delete(ctx context.Context, id int) error Update(ctx context.Context, mdata *MangaData) (*MangaData, error) ListMangaData(ctx context.Context, apiKey string) ([]MangaData, error) GetMangaDataByApiKey(ctx context.Context, apiKey string) (*MangaData, error) }
type Notification ¶
type Notification struct { ID int `json:"id"` Name string `json:"name"` Type NotificationType `json:"type"` Enabled bool `json:"enabled"` Events []string `json:"events"` Token string `json:"token"` APIKey string `json:"api_key"` Webhook string `json:"webhook"` Title string `json:"title"` Icon string `json:"icon"` Username string `json:"username"` Host string `json:"host"` Password string `json:"password"` Channel string `json:"channel"` Rooms string `json:"rooms"` Targets string `json:"targets"` Devices string `json:"devices"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type NotificationEvent ¶
type NotificationEvent string
const ( NotificationEventAppUpdateAvailable NotificationEvent = "SERVER_UPDATE_AVAILABLE" NotificationEventSyncStarted NotificationEvent = "SYNC_STARTED" NotificationEventSyncSuccess NotificationEvent = "SYNC_SUCCESS" NotificationEventSyncFailed NotificationEvent = "SYNC_FAILED" NotificationEventSyncError NotificationEvent = "SYNC_ERROR" NotificationEventTest NotificationEvent = "TEST" )
type NotificationEventArr ¶
type NotificationEventArr []NotificationEvent
type NotificationPayload ¶
type NotificationPayload struct { Subject string Message string Event NotificationEvent Timestamp time.Time }
type NotificationQueryParams ¶
type NotificationRepo ¶
type NotificationRepo interface { List(ctx context.Context) ([]Notification, error) Find(ctx context.Context, params NotificationQueryParams) ([]Notification, int, error) FindByID(ctx context.Context, id int) (*Notification, error) Store(ctx context.Context, notification Notification) (*Notification, error) Update(ctx context.Context, notification Notification) (*Notification, error) Delete(ctx context.Context, notificationID int) error }
type NotificationSender ¶
type NotificationSender interface { Send(event NotificationEvent, payload NotificationPayload) error CanSend(event NotificationEvent) bool }
type NotificationType ¶
type NotificationType string
const ( NotificationTypeDiscord NotificationType = "DISCORD" NotificationTypeNotifiarr NotificationType = "NOTIFIARR" NotificationTypeIFTTT NotificationType = "IFTTT" NotificationTypeJoin NotificationType = "JOIN" NotificationTypeMattermost NotificationType = "MATTERMOST" NotificationTypeMatrix NotificationType = "MATRIX" NotificationTypePushBullet NotificationType = "PUSH_BULLET" NotificationTypePushover NotificationType = "PUSHOVER" NotificationTypeRocketChat NotificationType = "ROCKETCHAT" NotificationTypeSlack NotificationType = "SLACK" NotificationTypeTelegram NotificationType = "TELEGRAM" )
type Sync ¶
type Sync struct { ID int `json:"id,omitempty"` LastSynced *time.Time `json:"last_synced,omitempty"` Status SyncStatus `json:"status,omitempty"` UserApiKey *APIKey `json:"user_api_key,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` LastSyncedEpoch int64 `json:"last_synced_epoch,omitempty"` }
type SyncLockFile ¶ added in v0.3.4
type SyncLockFile struct { ID int `json:"id,omitempty"` UserApiKey string `json:"user_api_key,omitempty"` AcquiredBy string `json:"acquired_by,omitempty"` LastSynced *time.Time `json:"last_synced,omitempty"` Status SyncStatus `json:"status,omitempty"` RetryCount int `json:"retry_count,omitempty"` AcquiredAt *time.Time `json:"acquired_at,omitempty"` ExpiresAt *time.Time `json:"expires_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
type SyncRepo ¶
type SyncRepo interface { Store(ctx context.Context, sync *Sync) (*Sync, error) Delete(ctx context.Context, id int) error Update(ctx context.Context, sync *Sync) (*Sync, error) ListSyncs(ctx context.Context, apiKey string) ([]Sync, error) GetSyncByApiKey(ctx context.Context, apiKey string) (*Sync, error) CreateSyncLockFile(ctx context.Context, apiKey string, acquiredBy string) (*SyncLockFile, error) GetSyncLockFile(ctx context.Context, apiKey string) (*SyncLockFile, error) UpdateSyncLockFile(ctx context.Context, syncLockFile *SyncLockFile) (*SyncLockFile, error) DeleteSyncLockFile(ctx context.Context, apiKey string) bool }
type SyncStatus ¶
type SyncStatus string
const ( SyncStatusPending SyncStatus = "pending" SyncStatusSyncing SyncStatus = "syncing" SyncStatusSuccess SyncStatus = "success" SyncStatusError SyncStatus = "error" )
type Tracking ¶ added in v0.2.1
type Tracking struct { SyncId *int `json:"syncId,omitempty"` LibraryId *int64 `json:"libraryId,omitempty"` MediaIdInt *int `json:"mediaIdInt,omitempty"` TrackingUrl *string `json:"trackingUrl,omitempty"` Title *string `json:"title,omitempty"` LastChapterRead *float64 `json:"lastChapterRead,omitempty"` TotalChapters *int `json:"totalChapters,omitempty"` Score *float64 `json:"score,omitempty"` Status *int `json:"status,omitempty"` StartedReadingDate *int64 `json:"startedReadingDate,omitempty"` FinishedReadingDate *int64 `json:"finishedReadingDate,omitempty"` MediaId *int64 `json:"mediaId,omitempty"` }
Click to show internal directories.
Click to hide internal directories.