Documentation
¶
Index ¶
- Constants
- func AdminToken() (string, error)
- func ForceDBSync() error
- func GetOutboundIP() (net.IP, error)
- func GetOutboundIPString() string
- func Init(event Event, cb LogCallback) error
- func IsRunning(t string) bool
- func LocalAddresses() string
- func RuntimeStatus() string
- func SecurityReport(mode string) string
- func SetAdminPassword(pwd string)
- func SetConfigData(path string)
- func SetConfigDebug(b bool)
- func SetConfigLogStd(b bool)
- func SetConfigNoPrefix(b bool)
- func Shutdown(timeout int64) (err error)
- func Start()
- func StartWithOptions(optionsJSON string) error
- type Event
- type LogCallback
Constants ¶
const ( ModeLocal = "local" ModeLan = "lan" ModePublic = "public" )
Network exposure modes. The app-level mode is authoritative for the bind address so that the embedded server listens on loopback unless the user explicitly opts into LAN or public access.
Variables ¶
This section is empty.
Functions ¶
func AdminToken ¶
AdminToken issues an admin JWT for the in-app native client. It must only be reachable through private app IPC, never through a network endpoint.
func ForceDBSync ¶
func ForceDBSync() error
ForceDBSync forces SQLite WAL checkpoint to sync data to main database file
func GetOutboundIP ¶
func GetOutboundIPString ¶
func GetOutboundIPString() string
func Init ¶
func Init(event Event, cb LogCallback) error
func LocalAddresses ¶
func LocalAddresses() string
LocalAddresses returns non-loopback IPv4 addresses joined by commas. Android 11+ may deny netlink access; callers there should enumerate interfaces natively and use this only as a fallback.
func RuntimeStatus ¶
func RuntimeStatus() string
RuntimeStatus returns listener state and Go runtime resource usage as JSON.
func SecurityReport ¶
SecurityReport returns the security checks for the given mode as JSON, evaluated against the current config without changing it.
func SetAdminPassword ¶
func SetAdminPassword(pwd string)
func SetConfigData ¶
func SetConfigData(path string)
func SetConfigDebug ¶
func SetConfigDebug(b bool)
func SetConfigLogStd ¶
func SetConfigLogStd(b bool)
func SetConfigNoPrefix ¶
func SetConfigNoPrefix(b bool)
func StartWithOptions ¶
StartWithOptions applies the exposure mode to the loaded config and starts the server. Init must be called first. Public mode refuses to start while any blocking security check fails.