urls

package
v0.0.0-...-e61e643 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package urls handles converting between various JIRA URL representations in a consistent way. There exists three main types of JIRA URL which Go-NEB cares about:

When making outbound requests to JIRA, Go-NEB needs to use the Base URL representation. Likewise, when Go-NEB sends Matrix messages with JIRA URLs in them, the Base URL needs to be used to form the URL. The URL Key is used to determine equivalence of various JIRA installations and is mainly required when searching the database. The REST URLs are present on incoming webhook events and are the only way to map the event to a JIRA installation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SameJIRAURL

func SameJIRAURL(a, b string) bool

SameJIRAURL returns true if the two given JIRA URLs are pointing to the same JIRA installation. Equivalence is determined solely by the provided URLs, by sanitising them then comparing.

Types

type JIRAURL

type JIRAURL struct {
	Base string // The base URL of the JIRA installation. Always has a trailing / and a protocol.
	Key  string // The URL key of the JIRA installation. Never has a trailing / or a protocol.
	Raw  string // The raw input URL, if given. Freeform.
}

JIRAURL contains the parsed representation of a JIRA URL

func ParseJIRAURL

func ParseJIRAURL(u string) (j JIRAURL, err error)

ParseJIRAURL parses a raw input URL and returns a struct which has various JIRA URL representations. The input URL can be a JIRA REST URL, a speculative base JIRA URL from a client, or a URL key. The input string will be stored as under JIRAURL.Raw. If a URL key is given, this struct will default to https as the protocol.

Jump to

Keyboard shortcuts

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