sonar

package module
v0.0.0-...-d10bb4d Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

README

Ensign-Sonar

A quick QA utility to send and receive events using Ensign.

Running Ensonar

Make sure you have your .env file setup using the .env.template file.

In one terminal:

$ go run ./cmd/ensonar/ sonar 2>/dev/null

Note: this redirects stderr to /dev/null so that errors aren't printed; you can also direct to a file to find out what is going wrong with the publisher.

In a second terminal:

$ go run ./cmd/ensonar listen

Documentation

Index

Constants

View Source
const (
	Mimetype   = "application/msgpack"
	DefaultTTL = 750 * time.Millisecond
	SchemaName = "ping"
)
View Source
const (
	VersionMajor         = 1
	VersionMinor         = 0
	VersionPatch         = 0
	VersionReleaseLevel  = ""
	VersionReleaseNumber = 1
)

Version component constants for the current build.

Variables

View Source
var GitVersion string

Set the GitVersion via -ldflags="-X 'github.com/bbengfort/ensign-sonar.GitVersion=$(git rev-parse --short HEAD)'"

Functions

func GetOutboundIP

func GetOutboundIP() net.IP

Get preferred outbound ip of this machine

func Hostname

func Hostname() string

func Version

func Version() string

Version returns the semantic version for the current build.

Types

type Ping

type Ping struct {
	Sequence  uint64        `msgpack:"sequence"`
	Hostname  string        `msgpack:"hostname"`
	IPAddress string        `msgpack:"ipaddr"`
	TTL       time.Duration `msgpack:"ttl"`
	Timestamp time.Time     `msgpack:"timestamp"`
	NBytes    int           `msgpack:"-"`
	Received  time.Time     `msgpack:"-"`
}

func (*Ping) Event

func (p *Ping) Event() *ensign.Event

func (*Ping) Marshal

func (p *Ping) Marshal() ([]byte, error)

func (*Ping) Size

func (p *Ping) Size() int

func (*Ping) String

func (p *Ping) String() string

func (*Ping) Timedelta

func (p *Ping) Timedelta() time.Duration

func (*Ping) Unmarshal

func (p *Ping) Unmarshal(data []byte) error

type Sonar

type Sonar struct {
	// contains filtered or unexported fields
}

func New

func New() *Sonar

func (*Sonar) Next

func (s *Sonar) Next() *Ping

Directories

Path Synopsis
cmd
ensonar command

Jump to

Keyboard shortcuts

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