link

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 15 Imported by: ? 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 implements `ytrack issue link`, and the link type lookup and JSON output that `ytrack issue unlink` shares.

Index

Constants

View Source
const LinkFieldsHelp = `` /* 370-byte string literal not displayed */

LinkFieldsHelp documents LinkFields for command help.

View Source
const TypeHelp = `--type takes a link phrase as the instance's link types define it, such as
"depends on", "is required for", "subtask of", "parent for", "duplicates" or
"relates to"; case is ignored. The phrase picks the direction: "A depends on
B" and "B is required for A" are the same link. An undirected link type also
answers to its name, e.g. "Relates"; a directed type's name, e.g. "Depend",
does not say which way the link goes and is refused. ` + "`ytrack issue link --list-types`" + `
lists the link types with both phrases.

The phrases are the link types' own, the same in every UI language, unlike
the localized command language: ` + "`ytrack issue command A 'depends on B'`" + ` works
only where YouTrack's command language is English.`

TypeHelp documents --type for command help.

Variables

View Source
var LinkFields = []string{"issue", "type", "phrase", "direction", "issues"}

LinkFields are the --json fields of a link: the links `--list` prints and the one `issue link` or `issue unlink` changed.

View Source
var TypeFields = []string{"id", "name", "sourceToTarget", "targetToSource", "directed"}

TypeFields are the --json fields of a link type (`--list-types`).

Functions

func CheckJSON

func CheckJSON(e *output.Exporter, fields []string, what string) error

CheckJSON refuses --json fields that what is printed does not have.

func HostRef

func HostRef(refs []shared.Ref) shared.Ref

HostRef returns the first ref given as a URL, which names the host.

func NewCmdLink(f *cmdutil.Factory) *cobra.Command

NewCmdLink returns the link command.

func Refs

func Refs(args []string) ([]shared.Ref, error)

Refs parses the issue and target arguments.

func ResolveType

func ResolveType(ctx context.Context, c *transport.Client, phrase string) (adapter.LinkEnd, error)

ResolveType reads the instance's link types and returns the end --type names; an unknown phrase or a directed type's name is a usage error that lists the valid values.

Types

type Result

type Result struct {
	Issue string
	adapter.IssueLink
}

Result is a link for --json output.

func (Result) ExportData

func (r Result) ExportData(fields []string) map[string]any

ExportData implements output.Exportable.

Jump to

Keyboard shortcuts

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