Documentation
¶
Overview ¶
Package deeplink parses the ssq:// URL scheme used for backlog item deep links (ssq://<hostname>/<type>/<version>/<id>). See project_plans/backlog-deep-linking/implementation/plan.md Story 2.1.
Index ¶
Constants ¶
const Scheme = "ssq"
Scheme is the URL scheme deep links use.
Variables ¶
var ErrMalformed = errors.New("deeplink: malformed ssq:// URL")
ErrMalformed indicates the raw string is not a well-formed ssq:// deep link: wrong scheme, missing hostname, or missing/empty path segments.
var ErrUnsupportedVersion = errors.New("deeplink: unsupported version")
ErrUnsupportedVersion indicates the URL is well-formed but names a deep-link version this binary does not recognize.
var SupportedVersions = map[string]bool{ "v1": true, }
SupportedVersions enumerates the deep-link path versions this binary can resolve. ParseDeepLink rejects any version not present here with ErrUnsupportedVersion rather than returning a DeepLink value carrying an unrecognized version — an unsupported-version DeepLink is never constructible.
Functions ¶
This section is empty.
Types ¶
type DeepLink ¶
DeepLink is the parsed form of an ssq://<hostname>/<type>/<version>/<id> link. A DeepLink value is only ever returned by ParseDeepLink on success, so every field is guaranteed non-empty and Version is guaranteed to be a member of SupportedVersions.
func ParseDeepLink ¶
ParseDeepLink parses raw as an ssq://<hostname>/<type>/<version>/<id> deep link. It returns ErrMalformed for anything that isn't well-formed (wrong scheme, missing hostname, missing/empty path segments) and ErrUnsupportedVersion when the URL is well-formed but names a version this binary doesn't recognize — the version check is folded into parsing itself so a DeepLink with an unsupported version is never returned.