link

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 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 reads Djinn's links, djinn://tilasm/<id> and djinn://wish/<id>, which open the app on what they name from anywhere: a browser, a chat, a terminal, a Markdown file. The system hands them to `djinn open`, which the scheme is registered with: a desktop entry on Linux (tools/icons), Djinn.app's Info.plist on macOS (tools/macapp), the registry on Windows (Register).

Index

Constants

View Source
const RegistryKey = `Software\Classes\` + Scheme

RegistryKey is where Windows reads the handler of djinn:// links for the user, in HKEY_CURRENT_USER: no administrator rights.

View Source
const Scheme = "djinn"

Scheme is the scheme of Djinn's links.

Variables

This section is empty.

Functions

func Of

func Of(kind Kind, id string) string

Of is the link of a tilasm or a wish by its identifier.

func OpenCommand

func OpenCommand(exe string) string

OpenCommand is the command Windows runs for a link: exe open "%1".

func Register

func Register(string) error

Register does nothing outside Windows: a desktop entry registers the scheme on Linux (tools/icons), Djinn.app's Info.plist on macOS (tools/macapp).

func Registered

func Registered() (bool, error)

Registered is true outside Windows: djinn up has nothing to register there.

Types

type Kind

type Kind string

Kind is what a link names.

const (
	// Tilasm names a tilasm: the window shows its wish's Tilasms tab on it.
	Tilasm Kind = "tilasm"
	// Wish names a wish: the window shows it.
	Wish Kind = "wish"
)
type Link struct {
	Kind Kind
	ID   string
}

Link is a link read: what it names, and its identifier, in lower case.

func Parse

func Parse(raw string) (Link, error)

Parse reads a link: djinn://tilasm/<id> or djinn://wish/<id>, the scheme and the kind in any case, a slash after the identifier, a query or a fragment allowed (a browser or a chat may add them). Anything else is an UnknownError.

func (Link) String

func (l Link) String() string

String is the link as Djinn writes it.

type RegistryValue

type RegistryValue struct {
	Key, Name, Data string
}

RegistryValue is one string value of the registry under RegistryKey: Key is a subkey ("" for RegistryKey itself), Name the value's name ("" for its default value).

func RegistryValues

func RegistryValues(exe string) []RegistryValue

RegistryValues are the values that make exe the handler of djinn:// links on Windows: the URL Protocol value names the key a scheme, and its open command runs `djinn open <link>`.

type UnknownError

type UnknownError struct{ URL string }

UnknownError is a link Djinn does not know.

func (UnknownError) Error

func (e UnknownError) Error() string

Jump to

Keyboard shortcuts

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