Versions in this module Expand all Collapse all v0 v0.1.0 Jul 17, 2026 Changes in this version + const APIVersion + const DefaultCheckTimeoutMS + const DefaultFailOpen + const DefaultLogMaxRetries + const DefaultLogQueueCapacity + const DefaultLogRetryBaseMS + const DefaultLogTimeoutMS + const SDKName + const Version + func UserAgent() string + type CheckResult struct + Action string + FailedOpen bool + ProcessingTimeUS int64 + RequestID string + Score float64 + TenantID string + Timestamp string + type Client struct + func New(apiKey string, opts ...Option) (*Client, error) + func (c *Client) Check(event Event) (CheckResult, error) + func (c *Client) Close(deadline time.Duration) error + func (c *Client) Log(event Event) + func (c *Client) Metrics() *Metrics + type ConfigError struct + Message string + func (e *ConfigError) Error() string + type EncryptedPayload struct + Encrypted string + Nonce string + Timestamp int64 + V *int + type Error interface + type Event struct + Custom map[string]any + IP string + Method string + Payload EncryptedPayload + Timestamp string + UserID string + type HTTPResponse struct + Body map[string]any + RequestID string + StatusCode int + type HTTPTransport struct + func NewHTTPTransport(apiKey, userAgent string, logger Logger) *HTTPTransport + func (t *HTTPTransport) Close() error + func (t *HTTPTransport) Post(url string, body map[string]any, opts PostOptions) (HTTPResponse, error) + type Logger interface + Debug func(msg string, fields map[string]any) + Error func(msg string, fields map[string]any) + Info func(msg string, fields map[string]any) + Warn func(msg string, fields map[string]any) + type Metrics struct + func (m *Metrics) Get(name string, labels map[string]string) int64 + func (m *Metrics) Snapshot() map[string]int64 + type NetworkError struct + Message string + func (e *NetworkError) Error() string + type NoopLogger struct + func (NoopLogger) Debug(msg string, fields map[string]any) + func (NoopLogger) Error(msg string, fields map[string]any) + func (NoopLogger) Info(msg string, fields map[string]any) + func (NoopLogger) Warn(msg string, fields map[string]any) + type Option func(*clientOptions) + func WithCheckTimeoutMS(ms int) Option + func WithFailOpen(v bool) Option + func WithLogMaxRetries(n int) Option + func WithLogQueueCapacity(n int) Option + func WithLogRetryBaseMS(ms int) Option + func WithLogTimeoutMS(ms int) Option + func WithLogger(l Logger) Option + func WithTransport(t Transport) Option + type PostOptions struct + IdempotencyKey string + RequestID string + TimeoutMS int + type ServerError struct + Code string + Details map[string]any + Message string + RequestID string + StatusCode int + func (e *ServerError) Error() string + type TimeoutError struct + Message string + func (e *TimeoutError) Error() string + type Transport interface + Close func() error + Post func(url string, body map[string]any, opts PostOptions) (HTTPResponse, error)