Versions in this module Expand all Collapse all v0 v0.2.0 Jul 22, 2026 Changes in this version + var Version = "dev" v0.1.3 Jun 14, 2026 v0.1.2 Jun 14, 2026 v0.1.1 Jun 14, 2026 v0.1.0 Jun 14, 2026 Changes in this version + const MaxRangeDays + func ParseExpiry(raw string, now time.Time) (string, error) + type APIError struct + Code string + Detail string + Message string + Status int + func (e *APIError) Error() string + type APIKey struct + CreatedAt int64 + Description string + ExpiresAt int64 + ID string + Name string + Revoked bool + Scopes []string + Token string + TokenPrefix string + type AliasCheck struct + Available bool + Reason string + type Client struct + func New(base string, store *auth.Store) *Client + func (c *Client) CheckAlias(ctx context.Context, alias, domain string) (*AliasCheck, error) + func (c *Client) CreateDomain(ctx context.Context, fqdn string) (*Domain, error) + func (c *Client) CreateKey(ctx context.Context, req CreateKeyRequest) (*APIKey, error) + func (c *Client) DeleteKey(ctx context.Context, id string, revoke bool) error + func (c *Client) DeleteURL(ctx context.Context, id string) error + func (c *Client) ExchangeDeviceCode(ctx context.Context, code string) (*DeviceTokens, error) + func (c *Client) Export(ctx context.Context, q StatsQuery, format string) (string, []byte, error) + func (c *Client) Inspect(ctx context.Context, shortCode string) (*InspectResult, error) + func (c *Client) ListDomains(ctx context.Context) (*DomainPage, error) + func (c *Client) ListKeys(ctx context.Context) ([]APIKey, error) + func (c *Client) ListURLs(ctx context.Context, opts ListURLsOptions) (*URLPage, error) + func (c *Client) Me(ctx context.Context) (*User, error) + func (c *Client) RevokeDomain(ctx context.Context, id string, cascade bool) (*DomainDeleteResult, error) + func (c *Client) Shorten(ctx context.Context, req ShortenRequest) (*ShortURL, error) + func (c *Client) Stats(ctx context.Context, q StatsQuery) (*StatsResponse, error) + func (c *Client) UpdateDomain(ctx context.Context, id string, fields map[string]any) (*Domain, error) + func (c *Client) UpdateURL(ctx context.Context, id string, fields map[string]any) (*UpdatedURL, error) + func (c *Client) VerifyDomain(ctx context.Context, id string) (*Domain, error) + type CreateKeyRequest struct + Description string + ExpiresAt string + Name string + Scopes []string + type DNSRecord struct + Name string + Type string + Value string + type DeviceTokens struct + AccessToken string + RefreshToken string + User User + type Domain struct + CreatedAt string + DNSRecords []DNSRecord + FQDN string + ID string + NotFoundRedirect string + RootRedirect string + Status string + VerifiedAt string + type DomainDeleteResult struct + Cascade bool + FQDN string + ID string + URLsDeleted int + type DomainPage struct + HasNext bool + Items []Domain + Page int + PageSize int + Total int + type InspectResult struct + Destination string + ShortURL string + Status int + type ListURLsOptions struct + Domain string + Page int + PageSize int + Search string + SortBy string + SortOrder string + Status string + type MetricPoint struct + Label string + Value float64 + type ShortURL struct + Alias string + CreatedAt int64 + LongURL string + ShortURL string + Status string + type ShortenRequest struct + Alias string + BlockBots bool + Domain string + ExpireAfter string + LongURL string + MaxClicks int + Password string + PrivateStats bool + type StatsQuery struct + EndDate string + Filters map[string][]string + GroupBy []string + Scope string + ShortCode string + StartDate string + Timezone string + type StatsResponse struct + ComputedMetrics map[string]float64 + GeneratedAt string + Metrics map[string][]map[string]any + Scope string + ShortCode string + Summary StatsSummary + TimeRange StatsTimeRange + func (r *StatsResponse) Points(dimension, metric string) []MetricPoint + type StatsSummary struct + AvgRedirectionTime float64 + FirstClick string + LastClick string + TotalClicks int + UniqueClicks int + type StatsTimeRange struct + EndDate string + StartDate string + type URLItem struct + Alias string + BlockBots bool + CreatedAt string + Domain string + ExpireAfter *int64 + ID string + LastClick string + LongURL string + MaxClicks *int + PasswordSet bool + PrivateStats bool + Status string + TotalClicks int + type URLPage struct + HasNext bool + Items []URLItem + Page int + PageSize int + Total int + type UpdatedURL struct + Alias string + BlockBots bool + Domain string + ExpireAfter *int64 + ID string + LongURL string + MaxClicks *int + PasswordSet bool + PrivateStats bool + Status string + UpdatedAt int64 + type User struct + Email string + EmailVerified bool + ID string + Name string + Plan string