Documentation
¶
Overview ¶
Package hookclient provides a gRPC client for the local agentd daemon.
Owns: dial transport, HookService/ConfigService/SessionService RPC wrappers. Must not: hook wire decode/encode (hookedge).
Entry: Dial, DialReady, Client.Invoke, Client.Subscribe, Client.Health. See DESIGN.md §1.5 (invoke_sync, async_side).
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) GetConfig(ctx context.Context, req *agentdv1.GetConfigRequest) (*agentdv1.GetConfigResponse, error)
- func (c *Client) Health(ctx context.Context) (*agentdv1.HealthResponse, error)
- func (c *Client) Invoke(ctx context.Context, req *agentdv1.InvokeRequest) (*agentdv1.InvokeResponse, error)
- func (c *Client) PatchConfig(ctx context.Context, req *agentdv1.PatchConfigRequest) (*agentdv1.PatchConfigResponse, error)
- func (c *Client) RecordDecision(ctx context.Context, req *agentdv1.RecordDecisionRequest) (*agentdv1.RecordDecisionResponse, error)
- func (c *Client) Reload(ctx context.Context) (*agentdv1.ReloadConfigResponse, error)
- func (c *Client) Shutdown(ctx context.Context) error
- func (c *Client) Status(ctx context.Context) (*agentdv1.StatusResponse, error)
- func (c *Client) Subscribe(ctx context.Context, req *agentdv1.SubscribeRequest) (agentdv1.SessionService_SubscribeClient, error)
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
}
Client wraps daemon, hook, config, and session service clients.
func Dial ¶
Dial connects to the daemon socket. Note: gRPC dial is lazy — prefer DialReady on the hook path when the process must fail closed/open immediately if the daemon is unreachable.
func DialReady ¶ added in v0.0.3
DialReady dials and confirms Health. Use on the hook hot path so an unreachable daemon is detected before the first Invoke (grpc.NewClient connects lazily).
func (*Client) GetConfig ¶
func (c *Client) GetConfig(ctx context.Context, req *agentdv1.GetConfigRequest) (*agentdv1.GetConfigResponse, error)
GetConfig fetches a config layer from the daemon.
func (*Client) Invoke ¶
func (c *Client) Invoke(ctx context.Context, req *agentdv1.InvokeRequest) (*agentdv1.InvokeResponse, error)
Invoke sends a hook invocation.
func (*Client) PatchConfig ¶
func (c *Client) PatchConfig(ctx context.Context, req *agentdv1.PatchConfigRequest) (*agentdv1.PatchConfigResponse, error)
PatchConfig applies a runtime overlay patch on the daemon.
func (*Client) RecordDecision ¶
func (c *Client) RecordDecision(ctx context.Context, req *agentdv1.RecordDecisionRequest) (*agentdv1.RecordDecisionResponse, error)
RecordDecision records an approval in the runtime overlay.
func (*Client) Subscribe ¶
func (c *Client) Subscribe(ctx context.Context, req *agentdv1.SubscribeRequest) (agentdv1.SessionService_SubscribeClient, error)
Subscribe opens a live trajectory event stream from the daemon.