Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultBaseURL = "https://bot-api.zapps.me"
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
func IsRateLimited ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is concurrency-safe and cheap to use; reuse one instance per process.
type HTTPError ¶
type HTTPError struct {
Status int
Message string // friendly message from the table above (or default)
Body string // raw body (truncated upstream if you want)
RetryAfter time.Duration // parsed from header when present
Temporary bool // hint for retry/backoff
}
HTTPError represents non-2xx responses.
type Logger ¶
type Logger interface {
Debug(msg string, fields map[string]any)
Info(msg string, fields map[string]any)
Warn(msg string, fields map[string]any)
Error(msg string, fields map[string]any)
}
Logger is minimal to avoid dependencies; plug your own slog/zap adapter.
type Option ¶
type Option func(*Client)
Option configures a Client.
func WithBaseURL ¶
func WithHTTPClient ¶
func WithLogger ¶
func WithUserAgent ¶
type SlogLogger ¶
type SlogLogger struct {
// contains filtered or unexported fields
}
SlogLogger implements the Logger interface using log/slog.
func NewSlogLogger ¶
func NewSlogLogger(l *slog.Logger) *SlogLogger
NewSlogLogger wraps an existing slog.Logger.
Click to show internal directories.
Click to hide internal directories.