serve

package
v0.0.0-...-3ce16b1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	InputTCPConnect []string `help:"TCP connect input addresses (e.g., 172.16.1.2:2000)" placeholder:"ADDR" group:"Input"`
	InputUDPListen  []int    `help:"UDP broadcast input listen ports (e.g., 2000)" placeholder:"PORT" group:"Input"`
	InputHTTPListen []int    `help:"HTTP input listen ports (e.g., 8080)" placeholder:"PORT" group:"Input"`
	InputSerial     []string `help:"Serial port inputs (e.g., /dev/ttyS0)" placeholder:"DEV" group:"Input"`
	InputStdin      bool     `help:"Read NMEA from standard input" group:"Input"`

	ForwardUDPAll              []string      `help:"UDP output destination address (all NMEA)" placeholder:"ADDR" group:"UDP output"`
	ForwardUDPAllMaxPacketSize int           `help:"Maximum UDP payload size (all NMEA)" default:"1472" group:"UDP output"`
	ForwardUDPAllMaxDelay      time.Duration `help:"Maximum UDP buffer delay (all NMEA)" default:"1s" group:"UDP output"`

	ForwardUDPAIS              []string      `name:"forward-ais-udp" help:"UDP output destination address (AIS only)" placeholder:"ADDR" group:"UDP output"`
	ForwardUDPAISMaxPacketSize int           `help:"Maximum UDP payload size (AIS only)" name:"forward-ais-udp-max-packet-size" default:"1472" group:"UDP output"`
	ForwardUDPAISMaxDelay      time.Duration `help:"Maximum UDP buffer delay (AIS only)" name:"forward-ais-udp-max-delay" default:"10s" group:"UDP output"`

	ForwardAllTCPListen string `default:":2000" help:"TCP listen address (all NMEA)" placeholder:"ADDR" group:"TCP output"`
	ForwardAISTCPListen string `default:":2010" name:"forward-ais-tcp-listen" help:"TCP listen address (AIS only)" placeholder:"ADDR" group:"TCP output"`

	OutputGPXPattern         string        `` /* 132-byte string literal not displayed */
	OutputGPXSampleInterval  time.Duration `help:"Time between track points" default:"10s" group:"GPX File Output"`
	OutputGPXMovingDistance  float64       `help:"Minimum travel in time window to consider us moving (meters)" default:"25" group:"GPX File Output"`
	OutputGPXStartTimeWindow time.Duration `help:"Movement time window for starting track" default:"1m" group:"GPX File Output"`
	OutputGPXStopTimeWindow  time.Duration `help:"Movement time window before ending track" default:"5m" group:"GPX File Output"`

	OutputRawPattern       string        `` /* 139-byte string literal not displayed */
	OutputRawBufferSize    int           `default:"131072" help:"Write buffer for output file" group:"Raw NMEA File Output"`
	OutputRawUncompressed  bool          `help:"Write uncompressed NMEA (default is gzipped)" group:"Raw NMEA File Output"`
	OutputRawTimeWindow    time.Duration `default:"24h" help:"How often to create a new raw file" group:"Raw NMEA File Output"`
	OutputRawFlushInterval time.Duration `default:"5m" help:"How often to flush raw data to disk" group:"Raw NMEA File Output"`

	PrometheusMetricsListen string `default:"127.0.0.1:9140" help:"HTTP listen address for Prometheus metrics endpoint" placeholder:"ADDR" group:"Metrics"`
}

func (*CLI) Run

func (cli *CLI) Run(ctx context.Context, logger *slog.Logger) error

type Flusher

type Flusher interface{ Flush() error }

type Tee

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

func NewFilteredTee

func NewFilteredTee(name string, input <-chan string, prefix string) *Tee

func NewTee

func NewTee(name string, input <-chan string) *Tee

func (*Tee) Output

func (t *Tee) Output() <-chan string

func (*Tee) Serve

func (t *Tee) Serve(ctx context.Context) error

func (*Tee) String

func (t *Tee) String() string

Jump to

Keyboard shortcuts

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