Documentation
¶
Index ¶
- func AccountsHandler(deps AccountsDeps) func(string, json.RawMessage) (interface{}, int, error)
- func DNSCacheHandler(deps DNSCacheDeps) func(string, json.RawMessage) (interface{}, int, error)
- func IrohHandler(deps SettingsToggleDeps) func(string, json.RawMessage) (interface{}, int, error)
- func JitRegistrationHandler(deps SettingsToggleDeps) func(string, json.RawMessage) (interface{}, int, error)
- func QueueHandler(deps QueueDeps) func(string, json.RawMessage) (interface{}, int, error)
- func QuotaHandler(deps QuotaDeps) func(string, json.RawMessage) (interface{}, int, error)
- func RegistrationHandler(deps SettingsToggleDeps) func(string, json.RawMessage) (interface{}, int, error)
- func ShadowsocksHandler(deps SettingsToggleDeps) func(string, json.RawMessage) (interface{}, int, error)
- func SharesHandler(deps SharesDeps) func(string, json.RawMessage) (interface{}, int, error)
- func StatusHandler(deps StatusDeps) func(method string, body json.RawMessage) (interface{}, int, error)
- func StorageHandler(deps StorageDeps) func(method string, body json.RawMessage) (interface{}, int, error)
- func TurnHandler(deps SettingsToggleDeps) func(string, json.RawMessage) (interface{}, int, error)
- type AccountsDeps
- type DNSCacheDeps
- type DatabaseInfo
- type DiskInfo
- type EmailServers
- type QueueDeps
- type QuotaDeps
- type ServiceStatus
- type SettingsToggleDeps
- type SharesDeps
- type StateDirInfo
- type StatusDeps
- type StatusResponse
- type StorageDeps
- type StorageResponse
- type TurnStatus
- type UptimeStatus
- type UsersStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountsHandler ¶
func AccountsHandler(deps AccountsDeps) func(string, json.RawMessage) (interface{}, int, error)
AccountsHandler creates a handler for /admin/accounts.
func DNSCacheHandler ¶
func DNSCacheHandler(deps DNSCacheDeps) func(string, json.RawMessage) (interface{}, int, error)
DNSCacheHandler creates a handler for /admin/dns.
func IrohHandler ¶
func IrohHandler(deps SettingsToggleDeps) func(string, json.RawMessage) (interface{}, int, error)
IrohHandler creates a handler for /admin/services/iroh.
func JitRegistrationHandler ¶
func JitRegistrationHandler(deps SettingsToggleDeps) func(string, json.RawMessage) (interface{}, int, error)
JitRegistrationHandler creates a handler for /admin/registration/jit.
func QueueHandler ¶
QueueHandler creates a handler for /admin/queue.
func QuotaHandler ¶
QuotaHandler creates a handler for /admin/quota.
func RegistrationHandler ¶
func RegistrationHandler(deps SettingsToggleDeps) func(string, json.RawMessage) (interface{}, int, error)
RegistrationHandler creates a handler for /admin/registration.
func ShadowsocksHandler ¶
func ShadowsocksHandler(deps SettingsToggleDeps) func(string, json.RawMessage) (interface{}, int, error)
ShadowsocksHandler creates a handler for /admin/services/shadowsocks.
func SharesHandler ¶
func SharesHandler(deps SharesDeps) func(string, json.RawMessage) (interface{}, int, error)
SharesHandler creates a handler for /admin/shares.
func StatusHandler ¶
func StatusHandler(deps StatusDeps) func(method string, body json.RawMessage) (interface{}, int, error)
StatusHandler creates a handler for /admin/status.
func StorageHandler ¶
func StorageHandler(deps StorageDeps) func(method string, body json.RawMessage) (interface{}, int, error)
StorageHandler creates a handler for /admin/storage.
func TurnHandler ¶
func TurnHandler(deps SettingsToggleDeps) func(string, json.RawMessage) (interface{}, int, error)
TurnHandler creates a handler for /admin/services/turn.
Types ¶
type AccountsDeps ¶
type AccountsDeps struct {
AuthDB module.PlainUserDB
Storage module.ManageableStorage
}
AccountsDeps are the dependencies needed by the accounts resource handler.
type DNSCacheDeps ¶
DNSCacheDeps are the dependencies needed by the DNS cache handler.
type DatabaseInfo ¶
type EmailServers ¶
type QueueDeps ¶
type QueueDeps struct {
Storage module.ManageableStorage
}
QueueDeps are the dependencies needed by the queue resource handler.
type QuotaDeps ¶
type QuotaDeps struct {
Storage module.ManageableStorage
}
QuotaDeps are the dependencies needed by the quota resource handler.
type ServiceStatus ¶
type SettingsToggleDeps ¶
type SettingsToggleDeps struct {
IsRegistrationOpen func() (bool, error)
SetRegistrationOpen func(bool) error
IsJitRegistrationEnabled func() (bool, error)
SetJitRegistrationEnabled func(bool) error
IsTurnEnabled func() (bool, error)
SetTurnEnabled func(bool) error
// Iroh and Shadowsocks are new DB-backed settings
GetSetting func(key string) (string, bool, error)
SetSetting func(key, value string) error
}
SettingsToggleDeps provides methods to read/write settings flags.
type SharesDeps ¶
type SharesDeps struct {
}
SharesDeps are the dependencies needed by the shares resource handler.
type StateDirInfo ¶
type StatusDeps ¶
StatusDeps are the dependencies needed by the status resource handler.
type StatusResponse ¶
type StatusResponse struct {
IMAP *ServiceStatus `json:"imap,omitempty"`
TURN *TurnStatus `json:"turn,omitempty"`
Shadowsocks *ServiceStatus `json:"shadowsocks,omitempty"`
Users *UsersStatus `json:"users"`
Uptime *UptimeStatus `json:"uptime"`
EmailServers *EmailServers `json:"email_servers,omitempty"`
}
StatusResponse is the response body for /admin/status.
type StorageDeps ¶
StorageDeps are the dependencies needed by the storage resource handler.
type StorageResponse ¶
type StorageResponse struct {
Disk *DiskInfo `json:"disk"`
StateDir *StateDirInfo `json:"state_dir"`
Database *DatabaseInfo `json:"database,omitempty"`
}
StorageResponse is the response body for /admin/storage.
type TurnStatus ¶
type TurnStatus struct {
Relays int `json:"relays"`
}
type UptimeStatus ¶
type UsersStatus ¶
type UsersStatus struct {
Registered int `json:"registered"`
}