openlistlib

package
v0.0.0-...-74d1977 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
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

func AdminToken() (string, error)

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 GetOutboundIP() (net.IP, error)

func GetOutboundIPString

func GetOutboundIPString() string

func Init

func Init(event Event, cb LogCallback) error

func IsRunning

func IsRunning(t string) bool

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

func SecurityReport(mode string) string

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 Shutdown

func Shutdown(timeout int64) (err error)

Shutdown timeout 毫秒

func Start

func Start()

Start starts the server

func StartWithOptions

func StartWithOptions(optionsJSON string) error

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.

Types

type Event

type Event interface {
	OnStartError(t string, err string)
	OnShutdown(t string)
	OnProcessExit(code int)
}

type LogCallback

type LogCallback interface {
	OnLog(level int16, time int64, message string)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL