Versions in this module Expand all Collapse all v0 v0.1.0 Jul 15, 2026 Changes in this version + func ClearDiscoveryCache() + type APIClient struct + BaseURL string + DefaultToken string + HTTP *http.Client + RefreshBufferSec int64 + Session *Session + func NewAPIClient(opts APIClientOptions) *APIClient + func (c *APIClient) Delete(ctx context.Context, path string, out any, opts *RequestOptions) error + func (c *APIClient) Do(ctx context.Context, method, path string, body, out any, opts *RequestOptions) error + func (c *APIClient) Get(ctx context.Context, path string, out any, opts *RequestOptions) error + func (c *APIClient) Patch(ctx context.Context, path string, body, out any, opts *RequestOptions) error + func (c *APIClient) Post(ctx context.Context, path string, body, out any, opts *RequestOptions) error + func (c *APIClient) Put(ctx context.Context, path string, body, out any, opts *RequestOptions) error + type APIClientOptions struct + BaseURL string + DefaultToken string + HTTP *http.Client + RefreshBufferSec int64 + Session *Session + type APIKey struct + CreatedAt string + ID string + Name string + Prefix string + Secret string + type APIKeysResource struct + func (r *APIKeysResource) Create(ctx context.Context, name, authToken string) (*APIKey, error) + func (r *APIKeysResource) Delete(ctx context.Context, id, authToken string) error + func (r *APIKeysResource) List(ctx context.Context, authToken string) ([]APIKey, error) + type AccountResource struct + func (r *AccountResource) ChangePassword(ctx context.Context, currentPassword, newPassword, authToken string) error + func (r *AccountResource) Delete(ctx context.Context, authToken string) error + func (r *AccountResource) Me(ctx context.Context, authToken string) (map[string]any, error) + func (r *AccountResource) Update(ctx context.Context, patch map[string]any, authToken string) (map[string]any, error) + type BillingInvoicesQuery struct + Limit int + type BillingPlan struct + Features []string + ID string + Monthly float64 + Name string + type BillingResource struct + func (r *BillingResource) Cancel(ctx context.Context, authToken string) (map[string]any, error) + func (r *BillingResource) Checkout(ctx context.Context, planID, authToken string) (*CheckoutResult, error) + func (r *BillingResource) Downgrade(ctx context.Context, planID, authToken string) (map[string]any, error) + func (r *BillingResource) History(ctx context.Context, authToken string) ([]map[string]any, error) + func (r *BillingResource) Invoices(ctx context.Context, q BillingInvoicesQuery, authToken string) ([]map[string]any, error) + func (r *BillingResource) Plan(ctx context.Context, authToken string) (map[string]any, error) + func (r *BillingResource) Plans(ctx context.Context, authToken string) ([]BillingPlan, error) + func (r *BillingResource) Subscription(ctx context.Context, authToken string) (map[string]any, error) + func (r *BillingResource) Usage(ctx context.Context, authToken string) (*BillingUsage, error) + type BillingUsage struct + AsOf string + LinksCreated int + MonthlyClickLimit int + MonthlyClicksUsed int + type CheckoutResult struct + URL string + type Claims struct + AccountID string + Aud string + Email string + EmailVerif bool + Exp int64 + Iat int64 + IdentityID string + IdentityType string + Iss string + MfaVerified bool + Name string + Raw map[string]any + Scope string + Sub string + func VerifyAccessToken(ctx context.Context, tokenOrHeader string, opts VerifyOptions) (*Claims, error) + type ClickStats struct + ByCountry []ClickStatsCountry + ByDay []ClickStatsByDay + ByDevice []ClickStatsDevice + ByReferer []ClickStatsReferer + TotalClicks int + UniqueVisitors int + type ClickStatsByDay struct + Clicks int + Date string + type ClickStatsCountry struct + Clicks int + Country string + type ClickStatsDevice struct + Clicks int + Device string + type ClickStatsReferer struct + Clicks int + Referer string + type Client struct + API *APIClient + APIKeys *APIKeysResource + Account *AccountResource + BaseURL string + Billing *BillingResource + Domains *DomainsResource + Links *LinksResource + QR *QRResource + Stats *StatsResource + Tags *TagsResource + Workspace *WorkspaceResource + func NewClient(opts ClientOptions) *Client + func (c *Client) Health(ctx context.Context) (*HealthStatus, error) + type ClientOptions struct + APIKey string + BaseURL string + HTTP *http.Client + Session *Session + type DeviceFlowStart struct + DeviceCode string + ExpiresIn int + Interval int + UserCode string + VerificationURI string + VerificationURIComplete string + func StartDeviceFlow(ctx context.Context, opts StartDeviceFlowOptions) (*DeviceFlowStart, error) + type DeviceTokens struct + AccessToken string + ExpiresAt int64 + RefreshToken string + Scope string + TokenType string + func PollDeviceToken(ctx context.Context, opts PollDeviceTokenOptions) (*DeviceTokens, error) + func RefreshAccessToken(ctx context.Context, opts RefreshAccessTokenOptions) (*DeviceTokens, error) + type DiscoveryDocument struct + AuthorizationEndpoint string + DeviceAuthorizationEndpoint string + EndSessionEndpoint string + Issuer string + JWKSURI string + TokenEndpoint string + UserInfoEndpoint string + func FetchDiscovery(ctx context.Context, issuer string, httpClient *http.Client) (*DiscoveryDocument, error) + type Domain struct + CreatedAt string + Domain string + ID string + Status string + type DomainsResource struct + func (r *DomainsResource) Add(ctx context.Context, domain, authToken string) (*Domain, error) + func (r *DomainsResource) List(ctx context.Context, authToken string) ([]Domain, error) + func (r *DomainsResource) Remove(ctx context.Context, id, authToken string) error + func (r *DomainsResource) Verify(ctx context.Context, id, authToken string) (*Domain, error) + type Error struct + Code string + Details map[string]any + Message string + RequestID string + Status int + func (e *Error) Error() string + type HealthStatus struct + Status string + type Link struct + Clicks int + CreatedAt string + Description *string + DomainID *string + ExpiresAt *string + ID string + Password bool + Slug string + Tags []string + Title *string + URL string + UpdatedAt string + WorkspaceID string + type LinkListPage struct + Items []Link + NextCursor string + type LinksBulkResult struct + Affected int + type LinksCreateInput struct + Description string + ExpiresAt string + Slug string + Tags []string + Title string + URL string + type LinksImportResult struct + Imported int + type LinksListQuery struct + Archived *bool + Cursor string + Limit int + Tag string + type LinksResource struct + func (r *LinksResource) Bulk(ctx context.Context, action string, ids []string, authToken string) (*LinksBulkResult, error) + func (r *LinksResource) Create(ctx context.Context, in LinksCreateInput, authToken string) (*Link, error) + func (r *LinksResource) Delete(ctx context.Context, idOrSlug, authToken string) error + func (r *LinksResource) Export(ctx context.Context, authToken string) (string, error) + func (r *LinksResource) Get(ctx context.Context, idOrSlug, authToken string) (*Link, error) + func (r *LinksResource) Import(ctx context.Context, csv, authToken string) (*LinksImportResult, error) + func (r *LinksResource) List(ctx context.Context, q LinksListQuery, authToken string) (*LinkListPage, error) + func (r *LinksResource) Update(ctx context.Context, idOrSlug string, patch map[string]any, authToken string) (*Link, error) + type PollDeviceTokenOptions struct + ClientID string + DeviceCode string + HTTPClient *http.Client + Interval int + Issuer string + OnPending func() + Sleep func(time.Duration) + type QRCode struct + CreatedAt string + ID string + ImageURL string + Label *string + Scans int + URL string + type QRCreateInput struct + Label string + URL string + type QRResource struct + func (r *QRResource) Create(ctx context.Context, in QRCreateInput, authToken string) (*QRCode, error) + func (r *QRResource) Delete(ctx context.Context, id, authToken string) error + func (r *QRResource) Download(ctx context.Context, id, authToken string) (string, error) + func (r *QRResource) Get(ctx context.Context, id, authToken string) (*QRCode, error) + func (r *QRResource) List(ctx context.Context, authToken string) ([]QRCode, error) + func (r *QRResource) Stats(ctx context.Context, id, authToken string) (*ClickStats, error) + type RefreshAccessTokenOptions struct + ClientID string + HTTPClient *http.Client + Issuer string + RefreshToken string + Scope string + type RequestOptions struct + AuthToken string + Headers map[string]string + Query map[string]any + type Session struct + ClientID string + Issuer string + func NewSession(opts SessionOptions) *Session + func (s *Session) AccessToken() string + func (s *Session) ExpiresAt() int64 + func (s *Session) IsExpired() bool + func (s *Session) Refresh(ctx context.Context) error + func (s *Session) RefreshToken() string + func (s *Session) SetTokens(accessToken, refreshToken string, expiresAt int64, scope string) + func (s *Session) WillExpireSoon(bufferSec int64) bool + type SessionOptions struct + AccessToken string + ClientID string + ExpiresAt int64 + HTTPClient *http.Client + Issuer string + RefreshToken string + Scope string + type StartDeviceFlowOptions struct + ClientID string + HTTPClient *http.Client + Issuer string + Scope string + type StatsResource struct + func (r *StatsResource) Export(ctx context.Context, idOrSlug, authToken string) (string, error) + func (r *StatsResource) Show(ctx context.Context, idOrSlug string, q StatsShowQuery, authToken string) (*ClickStats, error) + func (r *StatsResource) Workspace(ctx context.Context, q StatsShowQuery, authToken string) (*ClickStats, error) + type StatsShowQuery struct + From string + To string + type Tag struct + LinkCount int + Name string + type TagsResource struct + func (r *TagsResource) List(ctx context.Context, authToken string) ([]Tag, error) + type VerifyOptions struct + Audience string + Issuer string + RequireMFA bool + type Workspace struct + CreatedAt string + ID string + Name string + Plan string + type WorkspaceMembersResource struct + func (r *WorkspaceMembersResource) Add(ctx context.Context, email, role, authToken string) (map[string]any, error) + func (r *WorkspaceMembersResource) List(ctx context.Context, authToken string) ([]map[string]any, error) + func (r *WorkspaceMembersResource) Remove(ctx context.Context, memberID, authToken string) error + type WorkspaceResource struct + Members *WorkspaceMembersResource + func (r *WorkspaceResource) Rename(ctx context.Context, name, authToken string) (*Workspace, error) + func (r *WorkspaceResource) Show(ctx context.Context, authToken string) (*Workspace, error)