Documentation
¶
Overview ¶
Package client constructs a configured go-openfga client from resolved config.
Index ¶
Constants ¶
const DefaultRequestTimeout = 30 * time.Second
DefaultRequestTimeout bounds each HTTP exchange, including reading its body.
Variables ¶
This section is empty.
Functions ¶
func ParseHeaders ¶ added in v0.267.0
ParseHeaders turns repeated "Name: value" strings into an http.Header.
A later value for the same name replaces an earlier one, so a --header flag overrides the same header from the profile rather than sending both.
func ValidStoreID ¶ added in v0.267.0
ValidStoreID reports whether id is a well-formed store ID.
func ValidateStoreID ¶ added in v0.267.0
ValidateStoreID returns a usage error describing a malformed store ID, naming the configuration layer it came from so the user knows what to fix. source is config.Resolved's StoreIDSource.
Types ¶
type Option ¶
type Option func(*options)
Option configures optional client behavior layered on top of the resolved config (e.g. request capture for the TUI).
func WithCapture ¶
WithCapture records every HTTP request/response into rec by wrapping the base transport. The playground passes a Recorder to back its API Logs view; the CLI passes a TraceWriter under --debug to stream the exchange to stderr.
func WithTimeout ¶
WithTimeout sets the maximum duration of each HTTP exchange. Zero disables the deadline for callers that intentionally use a long-lived endpoint.