network

package
v0.0.0-...-26e86c7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const EventStatusChangedTopic = "network.status-changed"

Variables

View Source
var (
	ErrTargetResolutionFailed = errors.New("target ip resolution is failed")
)

Functions

func ResolveIP

func ResolveIP(target string) (net.IP, error)

ResolveIP resolve the target IP by using either ip formatted target or by domain, for now only support IPv4

Types

type EventNetworkDown

type EventNetworkDown struct {
	At time.Time `json:"x-at"`
}

func (*EventNetworkDown) Name

func (e *EventNetworkDown) Name() string

func (*EventNetworkDown) ToEvent

func (e *EventNetworkDown) ToEvent() *event.EventPayload

type EventNetworkUp

type EventNetworkUp struct {
	At time.Time `json:"x-at"`
}

func (*EventNetworkUp) Name

func (e *EventNetworkUp) Name() string

func (*EventNetworkUp) ToEvent

func (e *EventNetworkUp) ToEvent() *event.EventPayload

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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