hosts

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 6 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 hosts normalizes YouTrack service URLs.

A host is identified by its key: the service URL without scheme or trailing slash, e.g. "acme.youtrack.cloud" or "tools.acme.com/youtrack" for a Server install under a path prefix. The key names config entries and keyring items.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	// URL is the canonical service URL, e.g. https://tools.acme.com/youtrack.
	URL string
	// Key is URL without the scheme, e.g. tools.acme.com/youtrack.
	Key string
}

Host is a normalized YouTrack service location.

func Parse

func Parse(input string) (Host, error)

Parse normalizes user input such as "acme.youtrack.cloud", "https://acme.youtrack.cloud/", or "https://tools.acme.com/youtrack/api". Input without a scheme gets https.

func (Host) APIURL

func (h Host) APIURL() string

APIURL returns the REST API root, e.g. https://acme.youtrack.cloud/api.

func (Host) IsHTTPS

func (h Host) IsHTTPS() bool

IsHTTPS reports whether the service URL uses https.

func (Host) IsLoopback

func (h Host) IsLoopback() bool

IsLoopback reports whether the host is localhost or a loopback address.

func (Host) PlainHTTP

func (h Host) PlainHTTP() bool

PlainHTTP reports whether credentials would cross the network unencrypted: plain http to a host that is not loopback.

Jump to

Keyboard shortcuts

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