utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TotalPorts = 65536
	TCP        = "tcp"
	UDP        = "udp"
)

Variables

View Source
var (
	Methods = []string{"GET", "POST", "PUT", "PATCH", "DELETE"}
	Signals = []os.Signal{syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT}
)

Functions

func AddrByHostName

func AddrByHostName(hn string) string

AddrByHostName prints any addrs found for a given hostname.

func HasProtoScheme

func HasProtoScheme(a string) bool

HasProtoScheme evaluates whether or not 'http://' or 'https://' is present.

func HostNameByIP

func HostNameByIP(a string) string

HostnameByIP prints any hostnames found for a given IP.

Types

type Row

type Row []slog.Field

Row contains the fields of a structured log.

func (*Row) Add

func (r *Row) Add(name string, val interface{})

Add adds a field to the current row

func (*Row) Valid

func (r *Row) Valid() bool

Valid checks if the protocol field is unknown or not.

Jump to

Keyboard shortcuts

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