...
Package urls
import "github.com/matrix-org/go-neb/realms/jira/urls"
- Overview
- Index
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:
- URL Keys => matrix.org/jira
- Base URLs => https://matrix.org/jira/
- REST URLs => https://matrix.org/jira/rest/api/2/issue/12680
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.
In the call graph viewer below, each node
is a function belonging to this package
and its children are the functions it
calls—perhaps dynamically.
The root nodes are the entry points of the
package: functions that may be called from
outside the package.
There may be non-exported or anonymous
functions among them if they are called
dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring func
token.
Functions may be omitted if they were
determined to be unreachable in the
particular programs or tests that were
analyzed.
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.
type JIRAURL struct {
Base string
Key string
Raw string
}
JIRAURL contains the parsed representation of a JIRA URL
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.