deeplink

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 4 Imported by: 2 modules, 1 package

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 deeplink contains deeplink parsing helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDeeplinkLike

func IsDeeplinkLike(link string) bool

IsDeeplinkLike returns true if string may be a valid deeplink.

func ValidateDomain

func ValidateDomain(domain string) error

ValidateDomain validate given domain (user) name

Types

type DeepLink struct {
	Type Type
	Args url.Values
}

DeepLink represents Telegram deeplink.

func Expect

func Expect(link string, typ Type) (DeepLink, error)

Expect parses deeplink and check type its type.

func Parse

func Parse(link string) (DeepLink, error)

Parse parses and returns deeplink.

type Type

type Type string

Type is an enum type of Telegram deeplinks types.

const (
	// Resolve is deeplink like
	//
	// 	tg:resolve?domain={domain}
	// 	tg://resolve?domain={domain}
	// 	https://t.me/{domain}
	// 	https://telegram.me/{domain}
	//
	Resolve Type = "resolve"

	// Join is deeplink like
	//
	// 	tg:join?invite={hash}
	// 	tg://join?invite={hash}
	// 	https://t.me/joinchat/{hash}
	// 	https://telegram.me/joinchat/{hash}
	// 	t.me/+{hash}
	//
	Join Type = "join"

	// BusinessChat is deeplink like
	//
	// tg:message?slug={slug}
	// tg://message?slug={slug}
	// https://t.me/m/{slug}
	// https://telegram.me/m/{slug}
	//
	// See https://core.telegram.org/api/links#business-chat-links
	BusinessChat Type = "message"
)

Jump to

Keyboard shortcuts

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