GoodAnalytics.Core.Links (GoodAnalytics v0.1.1)

Copy Markdown View Source

Context for link CRUD operations.

Summary

Functions

Archives a link (soft delete, frees up domain/key).

Archives a link, scoped to a workspace.

Creates a tracked link.

Gets a link by ID.

Gets a link by ID, scoped to a workspace.

Gets a link by domain and key (only non-archived).

Gets all non-archived links that share a key, across every domain.

Atomically increments click counters on a link.

Gets click events for a link.

Gets click events for a link, scoped to a workspace.

Gets aggregated stats for a link.

Lists links for a workspace with optional filters.

Resolves a live (non-archived, non-expired) link by domain and key.

Resolves a live (non-archived, non-expired) link by key alone, ignoring domain.

Updates a link.

Updates a link, scoped to a workspace.

Functions

archive_link(id)

Archives a link (soft delete, frees up domain/key).

archive_link(workspace_id, id)

Archives a link, scoped to a workspace.

create_link(attrs)

Creates a tracked link.

get_link(id)

Gets a link by ID.

get_link(workspace_id, id)

Gets a link by ID, scoped to a workspace.

increment_clicks(link_id, unique? \\ true)

Atomically increments click counters on a link.

list_links(workspace_id, opts \\ [])

Lists links for a workspace with optional filters.

resolve_live_link(domain, key)

Resolves a live (non-archived, non-expired) link by domain and key.

Returns {:ok, link}, {:error, :not_found}, or {:error, :expired}.

update_link(id, attrs)

Updates a link.

update_link(workspace_id, id, attrs)

Updates a link, scoped to a workspace.