whatsapp

package
v0.9.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package whatsapp extracts phone numbers from WhatsApp URLs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(urlStr string) bool

Match returns true if the URL is a WhatsApp link with a phone number.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles WhatsApp URL parsing. No HTTP requests needed - just URL parsing.

func New

func New(_ context.Context, opts ...Option) (*Client, error)

New creates a WhatsApp client.

func (*Client) Fetch

func (c *Client) Fetch(ctx context.Context, urlStr string) (*profile.Profile, error)

Fetch extracts phone number from a WhatsApp URL.

type Option

type Option func(*Client)

Option configures a Client.

func WithHTTPCache

func WithHTTPCache(_ httpcache.Cacher) Option

WithHTTPCache is a no-op for WhatsApp (no HTTP requests needed).

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger sets a custom logger.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL