hosts

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	IP string
}

func NewEndpoint

func NewEndpoint(ip string) *Endpoint

func (*Endpoint) GetTags added in v0.2.0

func (e *Endpoint) GetTags() map[string]string

func (*Endpoint) IsIPv4 added in v0.2.0

func (e *Endpoint) IsIPv4() bool

func (*Endpoint) Ping

func (e *Endpoint) Ping(count int) (*ping.Statistics, error)

type Host

type Host struct {
	Hostname string
	IP       string
	Name     string
	Tags     map[string]string
}

func (*Host) GetEndpoints

func (h *Host) GetEndpoints() []*Endpoint

func (*Host) GetName

func (h *Host) GetName() string

func (*Host) GetTags

func (h *Host) GetTags() map[string]string

func (*Host) Ping

func (h *Host) Ping(count int) *[]*Result

func (*Host) ResolveHostname

func (h *Host) ResolveHostname() ([]string, error)

func (*Host) ReverseIP

func (h *Host) ReverseIP() ([]string, error)

type List

type List struct {
	Hosts *list.List
	// contains filtered or unexported fields
}

func NewList

func NewList() *List

func (*List) AddHostname

func (l *List) AddHostname(hostname string, tags map[string]string)

func (*List) AddIP

func (l *List) AddIP(ip string, tags map[string]string)

func (*List) Length

func (l *List) Length() int

func (*List) Ping

func (l *List) Ping(count int, interval int, resultChan chan *Result)

func (*List) Reset

func (l *List) Reset()

func (*List) Shuffle

func (l *List) Shuffle()

func (*List) Stop added in v0.4.0

func (l *List) Stop()

type Result

type Result struct {
	Stats *ping.Statistics
	Tags  map[string]string
	When  time.Time
}

Jump to

Keyboard shortcuts

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