fqdn

package module
v0.0.0-...-6f60894 Latest Latest
Warning

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

Go to latest
Published: May 1, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

README

go-fqdn

Simple wrapper around net and os golang standard libraries providing Fully Qualified Domain Name of the machine.

Usage

Get the library...

$ go get github.com/Showmax/go-fqdn

...and write some code.

package main

import (
	"fmt"
	"github.com/Showmax/go-fqdn"
)

func main() {
	fmt.Println(fqdn.Get())
}

fqdn.Get() returns:

  • machine's FQDN if found.
  • hostname if FQDN is not found.
  • return "unknown" if nothing is found.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() string

Get Fully Qualified Domain Name returns "unknown" or hostanme in case of error

Types

This section is empty.

Jump to

Keyboard shortcuts

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