Documentation
¶
Overview ¶
Package localclient binds secure daemon endpoint discovery and local IPC to the transport-neutral client contracts. It never resolves network names, falls back to TCP, starts a process, or retries an RPC.
Index ¶
- Variables
- type Connector
- func (connector *Connector) Close() error
- func (*Connector) Format(state fmt.State, _ rune)
- func (connector *Connector) GoString() string
- func (connector *Connector) Initialize(ctx context.Context, request client.InitializeRequest) (result client.Session, resultErr error)
- func (connector *Connector) LogValue() slog.Value
- func (*Connector) MarshalJSON() ([]byte, error)
- func (*Connector) String() string
- type Discovery
- func (discovery *Discovery) Close() error
- func (discovery *Discovery) Discover(ctx context.Context) (client.Connector, error)
- func (*Discovery) Format(state fmt.State, _ rune)
- func (discovery *Discovery) GoString() string
- func (discovery *Discovery) LogValue() slog.Value
- func (*Discovery) MarshalJSON() ([]byte, error)
- func (*Discovery) String() string
- type ExplicitDiscovery
- func (discovery *ExplicitDiscovery) Close() error
- func (discovery *ExplicitDiscovery) Discover(ctx context.Context) (client.Connector, error)
- func (*ExplicitDiscovery) Format(state fmt.State, _ rune)
- func (discovery *ExplicitDiscovery) GoString() string
- func (discovery *ExplicitDiscovery) LogValue() slog.Value
- func (*ExplicitDiscovery) MarshalJSON() ([]byte, error)
- func (*ExplicitDiscovery) String() string
- type StartupLock
- func (lock *StartupLock) Acquire(ctx context.Context) (managed.StartupLease, error)
- func (*StartupLock) Format(state fmt.State, _ rune)
- func (lock *StartupLock) GoString() string
- func (lock *StartupLock) LogValue() slog.Value
- func (*StartupLock) MarshalJSON() ([]byte, error)
- func (*StartupLock) String() string
Constants ¶
This section is empty.
Variables ¶
var ErrExplicitEndpointMismatch = errors.New("explicit local endpoint does not match protected metadata")
ErrExplicitEndpointMismatch reports that protected current-user metadata names a different endpoint than the address explicitly requested. Neither address is included because local paths may contain user information.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector lazily owns one authenticated local gRPC channel and grpcclient adapter. Reusing that adapter across Initialize calls preserves reconnect fencing state until Connector closes or endpoint discovery replaces it.
func (*Connector) Close ¶
Close fences every returned session and closes the one shared local gRPC channel. It is idempotent and safe to race with Initialize and Session.Close.
func (*Connector) Initialize ¶
func (connector *Connector) Initialize( ctx context.Context, request client.InitializeRequest, ) (result client.Session, resultErr error)
Initialize lazily dials the exact endpoint address and delegates one authenticated negotiation to the shared grpcclient adapter. It never retries a failed negotiation.
func (*Connector) MarshalJSON ¶
MarshalJSON makes accidental serialization visibly redacted.
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery adapts secure endpoint.Store discovery to managed connector discovery. Only endpoint.ErrNotFound returned as the exact error authorizes managed daemon startup.
func NewDiscovery ¶
NewDiscovery binds one endpoint store without performing discovery.
func (*Discovery) Close ¶
Close prevents future discovery and closes the currently cached connector.
func (*Discovery) MarshalJSON ¶
type ExplicitDiscovery ¶
type ExplicitDiscovery struct {
// contains filtered or unexported fields
}
ExplicitDiscovery resolves only one caller-selected address through the protected endpoint store. It never treats absence as startup authorization and never dials an address without matching active metadata and its token.
func NewExplicitDiscovery ¶
func NewExplicitDiscovery(store *endpoint.Store, requestedAddress string) (*ExplicitDiscovery, error)
NewExplicitDiscovery binds one protected endpoint store and exact requested address without reading metadata or opening an IPC connection.
func (*ExplicitDiscovery) Close ¶
func (discovery *ExplicitDiscovery) Close() error
Close prevents future discovery and closes the cached lazy connector.
func (*ExplicitDiscovery) Discover ¶
Discover reads active protected metadata, requires an exact address match, and returns a lazy authenticated connector. Endpoint absence, stale cleanup, malformed metadata, and mismatch are hard attach failures; none can authorize managed startup.
func (*ExplicitDiscovery) GoString ¶
func (discovery *ExplicitDiscovery) GoString() string
func (*ExplicitDiscovery) LogValue ¶
func (discovery *ExplicitDiscovery) LogValue() slog.Value
func (*ExplicitDiscovery) MarshalJSON ¶
func (*ExplicitDiscovery) MarshalJSON() ([]byte, error)
func (*ExplicitDiscovery) String ¶
func (*ExplicitDiscovery) String() string
type StartupLock ¶
type StartupLock struct {
// contains filtered or unexported fields
}
StartupLock adapts endpoint.Store startup serialization to managed startup.
func NewStartupLock ¶
func NewStartupLock(store *endpoint.Store) (*StartupLock, error)
NewStartupLock binds one endpoint store without acquiring its startup lock.
func (*StartupLock) Acquire ¶
func (lock *StartupLock) Acquire(ctx context.Context) (managed.StartupLease, error)
Acquire obtains one context-bounded, idempotently releasable startup lease.
func (*StartupLock) GoString ¶
func (lock *StartupLock) GoString() string
func (*StartupLock) LogValue ¶
func (lock *StartupLock) LogValue() slog.Value
func (*StartupLock) MarshalJSON ¶
func (*StartupLock) MarshalJSON() ([]byte, error)
func (*StartupLock) String ¶
func (*StartupLock) String() string