client

package
v0.265.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package client constructs a configured go-openfga client from resolved config.

Index

Constants

View Source
const DefaultRequestTimeout = 30 * time.Second

DefaultRequestTimeout bounds each HTTP exchange, including reading its body.

Variables

This section is empty.

Functions

func New

func New(r config.Resolved, opts ...Option) (*openfga.Client, error)

New builds an *openfga.Client from a resolved configuration. The store and authorization-model IDs are registered as client defaults so per-call overrides remain optional.

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

func WithCapture(rec *apilog.Recorder) Option

WithCapture records every HTTP request/response into rec by wrapping the base transport. Used by the playground's API Logs view; unused by CLI commands.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the maximum duration of each HTTP exchange. Zero disables the deadline for callers that intentionally use a long-lived endpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL