app

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package app implements Warden's controlling-app side: activating the network system extension and talking to its XPC daemon. Mirrors Warden's App/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateExtension

func ActivateExtension(bundleID string)

ActivateExtension submits an OSSystemExtensionRequest to install/activate the network system extension with the given bundle identifier, mirroring Warden's extension activation. The system presents its own approval UI; a full app would also set a request delegate to observe completion.

This only succeeds from a properly signed app bundle carrying the System Extension and Network Extension entitlements (see README).

func DeactivateExtension

func DeactivateExtension(bundleID string)

DeactivateExtension submits a deactivation request for bundleID.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a connection to the Warden daemon's XPC service.

func Connect

func Connect() Client

Connect dials the daemon mach service and configures the remote interface.

func (Client) AddRule

func (c Client) AddRule(r *shared.Rule) error

AddRule sends a new rule to the daemon (fire-and-forget).

func (Client) Close

func (c Client) Close()

Close tears down the connection.

func (Client) DeleteRule

func (c Client) DeleteRule(key, uuid string)

DeleteRule removes the rule (key, uuid) on the daemon.

func (Client) GetRules

func (c Client) GetRules() (map[string][]*shared.Rule, error)

GetRules requests the daemon's rule set (JSON), blocking up to 5s for the reply.

func (Client) ToggleRule

func (c Client) ToggleRule(key, uuid string, disabled bool)

ToggleRule enables/disables the rule (key, uuid) on the daemon.

Jump to

Keyboard shortcuts

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