Versions in this module Expand all Collapse all v1 v1.0.0 Nov 3, 2026 Changes in this version + const CodeAPIKeyFromWebPage + const CodeDisabledBySupport + const CodeIdempotencyKeyInProgress + const CodeIdempotencyKeyInvalid + const CodeIdempotencyKeyReused + const CodePermissionRequired + const DefaultBaseURL + const DefaultCursorOverlap + const DefaultTimeout + const Version + var ErrForbidden = errors.New("smstunnel: forbidden") + var ErrInvalidInput = errors.New("smstunnel: invalid input") + var ErrNotFound = errors.New("smstunnel: not found") + var ErrRateLimited = errors.New("smstunnel: rate limited") + var ErrServer = errors.New("smstunnel: server error") + var ErrUnauthorized = errors.New("smstunnel: unauthorized") + type APIError struct + Body []byte + Code string + Header http.Header + Message string + Permission string + RetryAfter time.Duration + StatusCode int + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + type Client struct + func NewClient(apiKey string, opts ...Option) (*Client, error) + func (c *Client) BaseURL() string + func (c *Client) GetMessageStatus(ctx context.Context, messageID string) (*MessageStatus, error) + func (c *Client) GetUsage(ctx context.Context) (*Usage, error) + func (c *Client) GoString() string + func (c *Client) ListPhones(ctx context.Context) ([]Phone, error) + func (c *Client) ListReceivedTexts(ctx context.Context, q ReceivedTextsQuery) (*ReceivedTextsPage, error) + func (c *Client) NewReceivedTextsCursor(opts ReceivedTextsCursorOptions) (*ReceivedTextsCursor, error) + func (c *Client) SendSMS(ctx context.Context, to, message string, opts ...SendOption) (*SendResult, error) + func (c *Client) SendSignInCode(ctx context.Context, to, message string, opts ...SendOption) (*SendResult, error) + func (c *Client) String() string + func (c *Client) UserAgent() string + type ConnectionError struct + Err error + func (e *ConnectionError) Error() string + func (e *ConnectionError) Timeout() bool + func (e *ConnectionError) Unwrap() error + type MessageStatus struct + DeliveredAt *time.Time + ErrorMessage string + ID string + PhoneNumber string + Raw json.RawMessage + SentAt *time.Time + State State + type Option func(*Client) error + func WithBaseURL(rawURL string) Option + func WithDefaultCountryCode(code string) Option + func WithHTTPClient(hc *http.Client) Option + func WithTimeout(d time.Duration) Option + func WithUserAgentSuffix(suffix string) Option + type Phone struct + ID string + LastSeenAt *time.Time + Name string + Online bool + type Quota int64 + const Unlimited + func (q *Quota) UnmarshalJSON(data []byte) error + func (q Quota) IsUnlimited() bool + func (q Quota) MarshalJSON() ([]byte, error) + func (q Quota) String() string + type ReceivedText struct + DeviceID string + DeviceName string + Encrypted bool + EncryptedPayload string + ID string + Message string + ReceivedAt time.Time + SIMSlot *int + Sender string + SubscriptionID *int + type ReceivedTextsCursor struct + func (rc *ReceivedTextsCursor) Next(ctx context.Context) ([]ReceivedText, error) + func (rc *ReceivedTextsCursor) Seen() []string + func (rc *ReceivedTextsCursor) Since() time.Time + type ReceivedTextsCursorOptions struct + DeviceID string + Overlap time.Duration + PageSize int + Phone string + Seen []string + Since time.Time + type ReceivedTextsPage struct + HasMore bool + Limit int + Page int + Texts []ReceivedText + Total int + type ReceivedTextsQuery struct + DeviceID string + Limit int + Page int + Phone string + Since time.Time + type Remaining struct + Clean Quota + Total Quota + type SendOption func(*sendSettings) + func WithCountryCode(code string) SendOption + func WithDeviceID(id string) SendOption + func WithIdempotencyKey(key string) SendOption + type SendResult struct + Branded bool + MessageID string + Queued bool + Raw json.RawMessage + Remaining *Remaining + Replayed bool + type State string + const StateDelivered + const StateFailed + const StatePending + const StateSent + const StateUnconfirmed + func (s State) Final() bool + type Usage struct + AccountType string + Enterprise *UsageEnterprise + Limits UsageLimits + Plan string + Raw json.RawMessage + Remaining UsageRemaining + Used UsageCounts + type UsageCounts struct + SMSBranded int64 + SMSClean int64 + SMSCleanMonth int64 + TwoFAClean int64 + type UsageEnterprise struct + ID string + Name string + type UsageLimits struct + SMSBrandedPerDay Quota + SMSClean Quota + SMSCleanPerMonth Quota + TwoFAClean Quota + type UsageRemaining struct + SMSBranded Quota + SMSClean Quota + SMSCleanMonth Quota + TwoFAClean Quota