Versions in this module Expand all Collapse all v1 v1.0.1 Oct 25, 2026 v1.0.0 Oct 7, 2026 Changes in this version + const DailyLimitExceededCode + const DefaultBaseURL + const DefaultTimeout + const DefaultWebhookMaxBodySize + const UserAgent + const Version + var ErrInvalidWebhookToken = errors.New("calisero: invalid webhook token: the request URL lacks the expected token") + type APIError struct + Details map[string]any + Err error + Message string + StatusCode int + TraceID string + func (e *APIError) Error() string + func (e *APIError) RequestID() string + func (e *APIError) Unwrap() error + type Account struct + Address string + City string + Code string + ContactPerson string + Country string + CreatedAt time.Time + Credit float64 + DailyLimit *int + DailyRemaining *int + Description string + Email string + FiscalCode string + IBAN string + ID string + Name string + Phone string + PostalCode *int + RegistryNumber string + Sandbox bool + SentToday int + State string + Status AccountStatus + func (a *Account) UnmarshalJSON(data []byte) error + type AccountService struct + func (s *AccountService) Get(ctx context.Context, accountID string) (*Response[Account], error) + type AccountStatus string + const AccountStatusActive + const AccountStatusDisabled + const AccountStatusPending + type AuthProvider interface + Token func(ctx context.Context) (string, error) + type AuthProviderFunc func(ctx context.Context) (string, error) + func (f AuthProviderFunc) Token(ctx context.Context) (string, error) + type Client struct + Accounts *AccountService + Messages *MessageService + OptOuts *OptOutService + Verifications *VerificationService + func NewClient(apiKey string, options ...Option) (*Client, error) + func (c *Client) BaseURL() string + func (c *Client) UserAgent() string + type CreateMessageRequest struct + Body string + CallbackURL string + Recipient string + ScheduleAt time.Time + Sender string + ShortenURLs bool + Validity int + VisibleBody string + type CreateOptOutRequest struct + Phone string + Reason string + type CreateVerificationRequest struct + Brand string + ExpiresIn int + Phone string + Template string + type DailyLimitExceededError struct + DailyLimit int + DailyRemaining int + ResetsAt time.Time + func (e *DailyLimitExceededError) Unwrap() error + type DeliveryStatus string + const DeliveryStatusDelivered + const DeliveryStatusSent + const DeliveryStatusUndelivered + type DeliveryWebhookHandler struct + MaxBodySize int64 + OnError func(r *http.Request, err error) + OnMessage func(r *http.Request, message *DeliveryWebhookMessage) error + Token string + func (h *DeliveryWebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type DeliveryWebhookMessage struct + DailyLimit *int + DailyRemaining *int + DeliveredAt *time.Time + MessageID string + Price float64 + Recipient string + RemainingBalance *float64 + ScheduleAt *time.Time + Sender string + SentAt *time.Time + SentToday *int + Status DeliveryStatus + func ParseDeliveryWebhook(body []byte) (*DeliveryWebhookMessage, error) + func (m *DeliveryWebhookMessage) UnmarshalJSON(data []byte) error + type ForbiddenError struct + func (e *ForbiddenError) Unwrap() error + type HTTPDoer interface + Do func(req *http.Request) (*http.Response, error) + type InvalidWebhookPayloadError struct + Err error + Message string + func (e *InvalidWebhookPayloadError) Error() string + func (e *InvalidWebhookPayloadError) Unwrap() error + type ListOptions struct + Page int + type Message struct + Body string + CallbackURL string + CreatedAt time.Time + DeliveredAt *time.Time + ID string + Parts int + Recipient string + ScheduledAt *time.Time + Sender string + SentAt *time.Time + ShortenedURLs []ShortenedLink + Status MessageStatus + func (m *Message) UnmarshalJSON(data []byte) error + type MessageService struct + func (s *MessageService) Create(ctx context.Context, request *CreateMessageRequest) (*Response[Message], error) + func (s *MessageService) Delete(ctx context.Context, messageID string) error + func (s *MessageService) Get(ctx context.Context, messageID string) (*Response[Message], error) + func (s *MessageService) List(ctx context.Context, options *ListOptions) (*Page[Message], error) + type MessageStatus string + const MessageStatusCanceled + const MessageStatusDelivered + const MessageStatusFailed + const MessageStatusPending + const MessageStatusQueued + const MessageStatusScheduled + const MessageStatusSent + const MessageStatusUndelivered + type NotFoundError struct + func (e *NotFoundError) Unwrap() error + type OptOut struct + CreatedAt time.Time + ID string + Phone string + Reason string + UpdatedAt time.Time + func (o *OptOut) UnmarshalJSON(data []byte) error + type OptOutService struct + func (s *OptOutService) Create(ctx context.Context, request *CreateOptOutRequest) (*Response[OptOut], error) + func (s *OptOutService) Delete(ctx context.Context, optOutID string) error + func (s *OptOutService) Get(ctx context.Context, optOutID string) (*Response[OptOut], error) + func (s *OptOutService) List(ctx context.Context, options *ListOptions) (*Page[OptOut], error) + func (s *OptOutService) Update(ctx context.Context, optOutID string, request *UpdateOptOutRequest) (*Response[OptOut], error) + type Option func(*settings) error + func WithAppInfo(name, version string) Option + func WithAuthProvider(provider AuthProvider) Option + func WithBaseURL(baseURL string) Option + func WithHTTPClient(httpClient HTTPDoer) Option + func WithTimeout(timeout time.Duration) Option + type Page struct + Data []T + Links PaginationLinks + Meta PaginationMeta + ResponseMeta ResponseMeta + func (p *Page[T]) HasNextPage() bool + type PaginationLinks struct + First string + Last string + Next string + Prev string + type PaginationMeta struct + CurrentPage int + From *int + Path string + PerPage int + To *int + type RateLimitedError struct + RateLimitLimit int + RateLimitRemaining int + RateLimitReset time.Time + RetryAfter time.Duration + func (e *RateLimitedError) Unwrap() error + type Response struct + Data T + ResponseMeta ResponseMeta + type ResponseMeta struct + DailyLimit *int + DailyRemaining *int + RateLimitLimit *int + RateLimitRemaining *int + TraceID string + type ServerError struct + func (e *ServerError) Unwrap() error + type ShortenedLink struct + ClickCount int + CreatedAt time.Time + ID string + LastClick *time.Time + OriginalLink string + ShortenedLink string + func (l *ShortenedLink) UnmarshalJSON(data []byte) error + type TransportError struct + func (e *TransportError) Unwrap() error + type UnauthorizedError struct + func (e *UnauthorizedError) Unwrap() error + type UpdateOptOutRequest struct + Phone string + Reason string + type ValidationError struct + ValidationErrors map[string][]string + func (e *ValidationError) Unwrap() error + type Verification struct + Attempts int + Brand string + CreatedAt time.Time + Expired bool + ExpiresAt time.Time + ID string + Phone string + Status VerificationStatus + Template string + VerifiedAt *time.Time + func (v *Verification) UnmarshalJSON(data []byte) error + type VerificationCheckRequest struct + Code string + Phone string + type VerificationListOptions struct + Page int + Status VerificationStatus + type VerificationService struct + func (s *VerificationService) Create(ctx context.Context, request *CreateVerificationRequest) (*Response[Verification], error) + func (s *VerificationService) Get(ctx context.Context, verificationID string) (*Response[Verification], error) + func (s *VerificationService) List(ctx context.Context, options *VerificationListOptions) (*Page[Verification], error) + func (s *VerificationService) Validate(ctx context.Context, request *VerificationCheckRequest) (*Response[Verification], error) + type VerificationStatus string + const VerificationStatusUnverified + const VerificationStatusVerified