Help us shape the future of Go! Take the 2026 Go Developer Survey

deeplink

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

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

View Source
const Scheme = "ssq"

Scheme is the URL scheme deep links use.

Variables

View Source
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.

View Source
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.

View Source
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 struct {
	Hostname string
	ItemType string
	Version  string
	ID       string
}

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(raw string) (DeepLink, error)

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.

Jump to

Keyboard shortcuts

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