Documentation
¶
Overview ¶
Package complexity is a client for the Firewall Complexity API, which scores the complexity of a user message in [0,1] so the load balancer can route by difficulty.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotConfigured = errors.New("complexity: client not configured")
ErrNotConfigured is returned when Score is called without a base URL and token provider.
ErrUnauthorized is returned when the Firewall Complexity API rejects the token.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client calls the Firewall Complexity API.
func NewClient ¶
func NewClient(baseURL string, tokenProvider TokenProvider, timeout time.Duration) *Client
NewClient builds a Client. Missing endpoint credentials leave it unconfigured.
func (*Client) Configured ¶
Configured reports whether the endpoint and token provider are configured.
type TokenProvider ¶ added in v0.34.0
TokenProvider supplies authentication tokens for Firewall requests.
Click to show internal directories.
Click to hide internal directories.