Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Raw []byte `json:"-"` Server ServerConfiguration `json:"server" jsonschema:"required"` Database DatabaseConfiguration `json:"database" jsonschema:"required"` User UserConfiguration `json:"user" jsonschema:"required"` Senders SenderConfiguration `json:"senders" jsonschema:"required,minProperties=1"` }
Configuration is the top level configuration.
func Load ¶
func Load(path string) *Configuration
func (*Configuration) Validate ¶
func (c *Configuration) Validate() (error, string)
type DatabaseConfiguration ¶
type GitHubConfiguration ¶
type SSOConfiguration ¶
type SSOConfiguration struct { // GitHub OAuth configuration, as for now, only GitHub is supported. GitHub GitHubConfiguration `json:"github" jsonschema:"required,title=GitHub OAuth"` }
type SenderConfiguration ¶
type SenderConfiguration struct { Telegram senderConfig.TelegramConfig `json:"telegram" jsonschema:"title=Telegram Sender"` FCM senderConfig.FCMConfig `json:"fcm" jsonschema:"title=Firebase Cloud Messaging Sender"` // Used as a fallback when no other sender is available. As it consumes extra battery and bandwidth on client side. Set to false if you don't need it. WebSocket bool `json:"websocket" jsonschema:"title=WebSocket Sender"` WebPush senderConfig.WebPushConfig `json:"webpush" jsonschema:"title=Web Push Sender"` // Not implemented yet. Should set to false. WNS bool `json:"wns" jsonschema:"title=Windows Notification Service Sender"` }
type ServerConfiguration ¶
type ServerConfiguration struct { // The address the server will listen on. Address string `json:"address" jsonschema:"required,title=Server address,default=0.0.0.0:14444"` Mode Mode `json:"mode"` // The URL the server is running on. With no trailing slash and path at the end. Used for generating oauth redirect links. URL string `json:"url" jsonschema:"required,title=Server URL,format=uri,example=https://push.learningman.top"` }
type UserConfiguration ¶
type UserConfiguration struct { // As for now, it's GitHub login list who will have admin access. Admins []string `json:"admins" jsonschema:"required,title=Admins,minItems=1"` // OAuth's configuration for GitHub SSO SSOConfiguration `json:"sso" jsonschema:"required,title=SSO"` }
Click to show internal directories.
Click to hide internal directories.