link

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package link parses Mattermost references into actionable parts: a post ID, a channel name, and (when present) a team name. It accepts permalinks, plain channel URLs, and bare 26-char Mattermost IDs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsID

func IsID(s string) bool

IsID reports whether s looks like a bare Mattermost ID.

Types

type Ref

type Ref struct {
	Team        string // team URL name, may be empty
	PostID      string // set for /pl/<id> links or bare post IDs
	ChannelName string // set for /channels/<name> links
}

Ref is the parsed result. Exactly one of PostID / ChannelName is meaningful depending on the input; Team is set when the URL carried it.

func Parse

func Parse(s string) (Ref, error)

Parse interprets a permalink, channel URL, or bare ID.

Supported forms:

https://host/<team>/pl/<post_id>        -> {Team, PostID}
https://host/<team>/channels/<name>     -> {Team, ChannelName}
<post_id>                                -> {PostID}

Jump to

Keyboard shortcuts

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