Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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 SyncRepo ¶
type SyncRepo interface { // Get etag of sync data. // For avoid memory usage, only the etag will be returned. GetSyncDataETag(ctx context.Context, apiKey string) (*string, error) // Get sync data and etag GetSyncDataAndETag(ctx context.Context, apiKey string) ([]byte, *string, error) // Create or replace sync data, returns the new etag. SetSyncData(ctx context.Context, apiKey string, data []byte) (*string, error) // Replace sync data only if the etag matches, // returns the new etag if updated, or nil if not. SetSyncDataIfMatch(ctx context.Context, apiKey string, etag string, data []byte) (*string, error) }
Click to show internal directories.
Click to hide internal directories.