client

package
v0.9.3-dev.7 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: GPL-3.0 Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(endpoint, token string) *Client

func NewHTTP

func NewHTTP(baseURL, token string, httpClient *http.Client) *Client

func NewHTTPWithCredentialProvider added in v0.9.3

func NewHTTPWithCredentialProvider(baseURL string, provider CredentialProvider, httpClient *http.Client) *Client

NewHTTPWithCredentialProvider adapts an injected HTTP client to per-request credentials. Unlike WithCredentialProvider it establishes no Unix filesystem or peer proof; callers choose and own the injected transport.

func WithCredentialProvider added in v0.9.3

func WithCredentialProvider(locator platform.ControlLocator, provider CredentialProvider) *Client

WithCredentialProvider uses verified Unix peers and a fresh credential per request.

func (*Client) ActivatePanel

func (c *Client) ActivatePanel(ctx context.Context, id string, request protocol.MutationRequest) (protocol.MutationResult, error)

ActivatePanel makes an installed panel the active Web GUI.

func (*Client) AddSubscription

func (*Client) CloseAllConnections

func (c *Client) CloseAllConnections(ctx context.Context, request protocol.MutationRequest) (protocol.MutationResult, error)

func (*Client) CloseConnection

func (c *Client) CloseConnection(ctx context.Context, id string, request protocol.MutationRequest) (protocol.MutationResult, error)

func (*Client) Connections

func (c *Client) Connections(ctx context.Context) (protocol.ConnectionList, error)

func (*Client) Core

func (c *Client) Core(ctx context.Context) (protocol.CoreStatus, error)

func (*Client) DelayProxy

func (c *Client) DelayProxy(ctx context.Context, name string, request protocol.DelayTestRequest) (protocol.DelayResult, error)

func (*Client) DelayTest

func (c *Client) DelayTest(ctx context.Context, group string, request protocol.DelayTestRequest) (protocol.DelayResult, error)

func (*Client) DisableSystemProxy

DisableSystemProxy clears Mihari-owned system proxy via the daemon mutation path.

func (*Client) DisableTun

func (c *Client) DisableTun(ctx context.Context, request protocol.TunMutationRequest) (protocol.TunStatus, error)

DisableTun disables managed TUN via the daemon mutation path.

func (*Client) EnableSystemProxy

EnableSystemProxy enables the OS system proxy via the daemon mutation path.

func (*Client) EnableTun

func (c *Client) EnableTun(ctx context.Context, request protocol.TunMutationRequest) (protocol.TunStatus, error)

EnableTun enables managed TUN via the daemon mutation path.

func (*Client) GeoIPStatus

func (c *Client) GeoIPStatus(ctx context.Context) (protocol.GeoIPStatus, error)

GeoIPStatus returns daemon-owned local database health.

func (*Client) GetInstallationStatus added in v0.9.3

func (c *Client) GetInstallationStatus(ctx context.Context) (protocol.InstallationStatus, error)

GetInstallationStatus reads installation completeness through authenticated local control.

func (*Client) InstallCore

func (*Client) InstallPanel

func (c *Client) InstallPanel(ctx context.Context, id string, request protocol.PanelInstallRequest) (protocol.MutationResult, error)

InstallPanel downloads and installs a panel build.

func (*Client) Logging added in v0.9.2

func (c *Client) Logging(ctx context.Context) (protocol.LoggingStatus, error)

Logging returns the daemon-owned effective file logging configuration.

func (*Client) LookupGeoIP

LookupGeoIP resolves a bounded batch through the daemon.

func (*Client) Onboarding

func (c *Client) Onboarding(ctx context.Context) (protocol.OnboardingStatus, error)

func (*Client) OpenMachineSnapshot added in v0.9.3

func (c *Client) OpenMachineSnapshot(ctx context.Context, window logging.SnapshotWindow) (logging.SnapshotSet, error)

OpenMachineSnapshot starts a machine-log NDJSON stream and returns a SnapshotSet that borrows the HTTP response body until Close.

func (*Client) OpenWebGUI

func (c *Client) OpenWebGUI(ctx context.Context, panelID string) (protocol.WebGUIOpenResult, error)

OpenWebGUI returns a short-lived open URL for the local browser helper. panelID selects an installed panel; empty opens the default active panel.

func (*Client) Panels

func (c *Client) Panels(ctx context.Context) (protocol.PanelList, error)

Panels lists supported panels and install state.

func (*Client) ProxyGroups

func (c *Client) ProxyGroups(ctx context.Context) (protocol.ProxyGroups, error)

func (*Client) RefreshSubscription

func (c *Client) RefreshSubscription(ctx context.Context, id string, request protocol.MutationRequest) (protocol.SubscriptionResult, error)

func (*Client) ReinstallPanel

func (c *Client) ReinstallPanel(ctx context.Context, id string, request protocol.MutationRequest) (protocol.MutationResult, error)

ReinstallPanel uninstalls then reinstalls the latest build for a panel.

func (*Client) RemoveSubscription

func (c *Client) RemoveSubscription(ctx context.Context, id string, request protocol.MutationRequest) (protocol.MutationResult, error)

func (*Client) RestartCore

func (c *Client) RestartCore(ctx context.Context, request protocol.MutationRequest) (protocol.MutationResult, error)

func (*Client) RollbackPanel

func (c *Client) RollbackPanel(ctx context.Context, id string, request protocol.MutationRequest) (protocol.MutationResult, error)

RollbackPanel restores the retained previous build for a panel.

func (*Client) RuleProviders

func (c *Client) RuleProviders(ctx context.Context) (protocol.RuleProviderList, error)

func (*Client) Rules

func (c *Client) Rules(ctx context.Context) (protocol.RuleList, error)

func (*Client) SelectProxy

func (c *Client) SelectProxy(ctx context.Context, group string, request protocol.ProxySelectionRequest) (protocol.MutationResult, error)

func (*Client) ServiceStatus added in v0.4.0

func (c *Client) ServiceStatus(ctx context.Context) (protocol.ServiceStatus, error)

ServiceStatus returns the advisory OS service registration state for onboarding review.

func (*Client) SetDiagnosticReporter added in v0.9.3

func (c *Client) SetDiagnosticReporter(reporter diagnostics.Reporter) error

SetDiagnosticReporter binds an optional diagnostics reporter before the first request.

func (*Client) SetRedactor added in v0.9.3

func (c *Client) SetRedactor(r *logging.Redactor) error

SetRedactor binds the process redactor before the first request.

func (*Client) SetSubscriptionEnabled

func (c *Client) SetSubscriptionEnabled(ctx context.Context, id string, request protocol.SubscriptionEnabledRequest) (protocol.SubscriptionResult, error)

func (*Client) SetToken added in v0.9.2

func (c *Client) SetToken(token string)

SetToken replaces the Bearer token. An empty token is a no-op.

func (*Client) Status

func (c *Client) Status(ctx context.Context) (protocol.Status, error)

func (*Client) Stream

func (c *Client) Stream(ctx context.Context, kind string, receive func(protocol.StreamEvent) error) error

func (*Client) Subscription

func (c *Client) Subscription(ctx context.Context, id string) (protocol.SubscriptionResult, error)

func (*Client) Subscriptions

func (c *Client) Subscriptions(ctx context.Context) (protocol.SubscriptionList, error)

func (*Client) SystemProxy

func (c *Client) SystemProxy(ctx context.Context) (protocol.SystemProxyStatus, error)

SystemProxy returns desired intent and live OS system-proxy observation.

func (*Client) TUIPreferences

func (c *Client) TUIPreferences(ctx context.Context) (protocol.TUIPreferences, error)

func (*Client) Tun

func (c *Client) Tun(ctx context.Context) (protocol.TunStatus, error)

Tun returns desired managed TUN intent and live mihomo observation when available.

func (*Client) UninstallPanel

func (c *Client) UninstallPanel(ctx context.Context, id string, request protocol.MutationRequest) (protocol.MutationResult, error)

UninstallPanel removes all local builds for a panel.

func (*Client) UpdateGeoIP

UpdateGeoIP requests a coordinated Country/ASN database refresh.

func (*Client) UpdateLogging added in v0.9.2

func (c *Client) UpdateLogging(ctx context.Context, request protocol.LoggingUpdateRequest) (protocol.LoggingStatus, error)

UpdateLogging applies a partial daemon-owned file logging configuration update.

func (*Client) UpdateOnboarding

func (*Client) UpdatePanel

func (c *Client) UpdatePanel(ctx context.Context, id string, request protocol.MutationRequest) (protocol.MutationResult, error)

UpdatePanel updates a panel to the latest resolved build.

func (*Client) UpdateRuleProvider

func (c *Client) UpdateRuleProvider(ctx context.Context, name string, request protocol.MutationRequest) (protocol.MutationResult, error)

func (*Client) UpdateSubscription

func (c *Client) UpdateSubscription(ctx context.Context, id string, request protocol.SubscriptionUpdateRequest) (protocol.SubscriptionResult, error)

func (*Client) UpdateTUIPreferences

func (c *Client) UpdateTUIPreferences(ctx context.Context, request protocol.UpdateTUIPreferencesRequest) (protocol.TUIPreferences, error)

func (*Client) UseSubscription

func (c *Client) UseSubscription(ctx context.Context, id string, request protocol.MutationRequest) (protocol.SubscriptionResult, error)

func (*Client) WebGUI

func (c *Client) WebGUI(ctx context.Context) (protocol.WebGUIStatus, error)

WebGUI returns the secret-free gateway and panel status.

type CredentialProvider added in v0.9.3

type CredentialProvider interface {
	Load(context.Context) (string, error)
}

CredentialProvider reads the current credential for one logical request. Implementations must support concurrent calls and must never fall back to a cached token.

Jump to

Keyboard shortcuts

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