hostname

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT-0 Imports: 5 Imported by: 0

Documentation

Overview

set or print the system hostname.

SYNOPSIS

hostname [-s] [HOSTNAME]

DESCRIPTION

hostname utility is used to set or print the name of the current host. If no argument is given, the name of the current host is printed.

The options are as follows:

-s        Trim any domain information from the printed name.

SEE ALSO

https://golang.org/pkg/os/#Hostname

REFERENCES

https://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/hostname.html
https://man.openbsd.org/hostname.1

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetHostname

func SetHostname(hostname []byte) error

Types

type Options

type Options struct {
	Strip bool
}

func (*Options) Hostname

func (opt *Options) Hostname(hostname string) error

type Opts

type Opts func(*Options)

func Strip

func Strip(strip bool) Opts

Jump to

Keyboard shortcuts

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