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.
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 with a static bearer token.
func NewClient ¶
NewClient builds a Client. An empty baseURL or token leaves it unconfigured (see Configured), so callers can fall back to another strategy.
func (*Client) Configured ¶
Configured reports whether both a base URL and token are set.
Click to show internal directories.
Click to hide internal directories.