Documentation
¶
Overview ¶
Package client provides a bounded, authenticated HTTP client for Questlock. Publish never automatically retries. To retry after an uncertain response, reuse the exact same request and operation ID so the server can replay it.
Index ¶
- Constants
- type Client
- func (c *Client) Audit(ctx context.Context, limit int) ([]protocol.AuditEvent, error)
- func (c *Client) Get(ctx context.Context, key string) (protocol.Artifact, error)
- func (c *Client) Identity(ctx context.Context) (protocol.Identity, error)
- func (c *Client) List(ctx context.Context) ([]protocol.Artifact, error)
- func (c *Client) Publish(ctx context.Context, request protocol.PublishRequest) (protocol.PublishResult, error)
- func (c *Client) PublishPinned(ctx context.Context, expected protocol.Identity, r protocol.PublishRequest) (protocol.PublishResult, error)
- func (c *Client) Sync(ctx context.Context, request protocol.SyncRequest) (protocol.SyncPage, error)
- type Error
Constants ¶
const ( DefaultTimeout = 15 * time.Second MaxResponseBytes = 16 << 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client may be shared by concurrent goroutines. Its credentials are sent only to the configured server; redirects are rejected.
func New ¶
New creates a client with a 15-second request timeout and 16MiB response limit. Plain HTTP is accepted only for literal loopback IP addresses. All other hosts require HTTPS. Environment proxy settings are deliberately ignored.
func NewWithTLSRoots ¶ added in v0.9.0
NewWithTLSRoots adds explicit PEM roots to the system trust store. It never disables hostname/certificate verification or changes the OS trust settings.
func (*Client) Publish ¶
func (c *Client) Publish(ctx context.Context, request protocol.PublishRequest) (protocol.PublishResult, error)
func (*Client) PublishPinned ¶ added in v0.8.0
func (c *Client) PublishPinned(ctx context.Context, expected protocol.Identity, r protocol.PublishRequest) (protocol.PublishResult, error)
PublishPinned preserves Publish's exact request/receipt semantics and adds an identity precondition checked in the authoritative SQLite transaction. Its dedicated route makes older brokers reject it before any publication.