jniservicebindconfig

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Overview

Package jniservicebindconfig resolves Android jniservice listener settings from defaults, durable config, staged launch config, and process environment.

Example: Load keeps transient launcher overrides separate from its durable config file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Listen string
	Port   string
}

Config contains the jniservice listener host and port.

Example: Config{Listen: "127.0.0.1", Port: "50051"} represents the safe defaults.

func Load

func Load(path string, env map[string]string) (Config, error)

Load applies safe defaults, the selected config file, the optional staged launch config, and then nonempty listener environment overrides. Only missing files are optional; other read and parse errors stop startup so the service cannot silently bind to an unintended address.

Example: env["JNISERVICE_LAUNCH_CONFIG"] selects transient listener overrides for this launch.

func Merge

func Merge(env map[string]string, file Config) Config

Merge combines the loopback defaults, file values, and nonempty environment overrides in that order. Only listener keys are consulted.

Example: Merge(env, Config{Port: "50052"}) applies the file port before environment overrides.

func Parse

func Parse(data []byte) (Config, error)

Parse reads listener values from KEY=VALUE lines without executing shell syntax. Unknown keys and comments are ignored.

Example: Parse([]byte("JNISERVICE_PORT=50052\n")) returns port 50052.

Jump to

Keyboard shortcuts

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