host

package
v0.1.75 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 18

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

func Parse(name string) (Name, error)

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

func (n Name) String() string

Returns a typical M-Lab machine hostname Example: mlab2-abc01.mlab-sandbox.measurement-lab.org

func (Name) StringAll added in v0.1.58

func (n Name) StringAll() string

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

func (n Name) StringWithService() string

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

func (n Name) StringWithSuffix() string

Returns an M-lab hostname with any suffix preserved Example: mlab1-abc01.mlab-sandbox.measurement-lab.org-gz77

Jump to

Keyboard shortcuts

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