Documentation ¶
Overview ¶
Package host parses v1 and v2 hostnames into their constituent parts. It is intended to help in the transition from v1 to v2 names on the platform. M-Lab go programs that need to parse hostnames should use this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Name ¶
type Name struct { Service string Machine string Site string Project string Org string Domain string Suffix string Version string }
Name represents an M-Lab hostname and all of its constituent parts.
func Parse ¶
Parse parses an M-Lab hostname and breaks it into its constituent parts. Parse also accepts service names and discards the service portion of the name.
func (Name) String ¶ added in v0.1.41
Returns a typical M-Lab machine hostname Example: mlab2-abc01.mlab-sandbox.measurement-lab.org
func (Name) StringAll ¶ added in v0.1.58
Returns an M-lab hostname with any service and suffix preserved Example: ndt-mlab1-abc01.mlab-sandbox.measurement-lab.org-gz77
func (Name) StringWithService ¶ added in v0.1.58
Returns an M-lab hostname with any service name preserved Example: ndt-mlab1-abc01.mlab-sandbox.measurement-lab.org
func (Name) StringWithSuffix ¶ added in v0.1.58
Returns an M-lab hostname with any suffix preserved Example: mlab1-abc01.mlab-sandbox.measurement-lab.org-gz77