Documentation
¶
Overview ¶
Package client is the thin HTTP consumer SDK for the Hanzo Notify service. Targets the /v1/notify/* surface notifyd exposes; every method maps 1:1 to one HTTP endpoint with no client-side fan-out.
Auth is bearer-token: callers provide a Hanzo IAM JWT (via WithToken) which notifyd validates against IAM's JWKS.
Index ¶
- type APIError
- type Client
- func (c *Client) Message(ctx context.Context, id string) (*types.Message, error)
- func (c *Client) Providers(ctx context.Context) ([]types.Provider, error)
- func (c *Client) Send(ctx context.Context, req types.SendRequest, sync bool) (*types.SendResponse, error)
- func (c *Client) Templates(ctx context.Context) ([]types.Template, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
APIError is returned for non-2xx HTTP responses. Routes layer encodes a JSON error envelope; this preserves the raw body for callers that want to inspect provider-specific failure detail.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the canonical HTTP consumer SDK.
func New ¶
New returns a Client targeting baseURL (e.g. "https://notify.hanzo.ai"). baseURL is parsed once at construction; an invalid URL returns an error rather than panicking later in a Send call.
func (*Client) Send ¶
func (c *Client) Send(ctx context.Context, req types.SendRequest, sync bool) (*types.SendResponse, error)
Send dispatches one notification. With sync=false (the default async mode) notifyd enqueues a hanzoai/tasks workflow and returns a task_id immediately; with sync=true notifyd blocks until the provider either accepts the message or returns an error.
type Option ¶
type Option func(*Client)
Option configures a Client at construction time.
func WithHTTPClient ¶
WithHTTPClient swaps the underlying http.Client (e.g. for retries, tracing, or test fakes).