confignet

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 1 Imported by: 74

README

Network Configuration Settings

Receivers leverage network configuration to set connection and transport information.

  • endpoint: Configures the address for this network connection. For TCP and UDP networks, the address has the form "host:port". The host must be a literal IP address, or a host name that can be resolved to IP addresses. The port must be a literal port number or a service name. If the host is a literal IPv6 address it must be enclosed in square brackets, as in "[2001:db8::1]:80" or "[fe80::1%zone]:80". The zone specifies the scope of the literal IPv6 address as defined in RFC 4007.
  • transport: Known protocols are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only), "udp", "udp4" (IPv4-only), "udp6" (IPv6-only), "ip", "ip4" (IPv4-only), "ip6" (IPv6-only), "unix", "unixgram" and "unixpacket".

Note that for TCP receivers only the endpoint configuration setting is required.

Documentation

Overview

Package confignet implements the configuration settings for protocols to connect and transport data information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetAddr

type NetAddr struct {
	// Endpoint configures the address for this network connection.
	// For TCP and UDP networks, the address has the form "host:port". The host must be a literal IP address,
	// or a host name that can be resolved to IP addresses. The port must be a literal port number or a service name.
	// If the host is a literal IPv6 address it must be enclosed in square brackets, as in "[2001:db8::1]:80" or
	// "[fe80::1%zone]:80". The zone specifies the scope of the literal IPv6 address as defined in RFC 4007.
	Endpoint string `mapstructure:"endpoint"`

	// Transport to use. Known protocols are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only), "udp", "udp4" (IPv4-only),
	// "udp6" (IPv6-only), "ip", "ip4" (IPv4-only), "ip6" (IPv6-only), "unix", "unixgram" and "unixpacket".
	Transport string `mapstructure:"transport"`
}

NetAddr represents a network endpoint address.

func (*NetAddr) Dial

func (na *NetAddr) Dial() (net.Conn, error)

Dial equivalent with net.Dial for this address.

func (*NetAddr) Listen

func (na *NetAddr) Listen() (net.Listener, error)

Listen equivalent with net.Listen for this address.

type TCPAddr added in v0.7.0

type TCPAddr struct {
	// Endpoint configures the address for this network connection.
	// The address has the form "host:port". The host must be a literal IP address, or a host name that can be
	// resolved to IP addresses. The port must be a literal port number or a service name.
	// If the host is a literal IPv6 address it must be enclosed in square brackets, as in "[2001:db8::1]:80" or
	// "[fe80::1%zone]:80". The zone specifies the scope of the literal IPv6 address as defined in RFC 4007.
	Endpoint string `mapstructure:"endpoint"`
}

TCPAddr represents a TCP endpoint address.

func (*TCPAddr) Dial added in v0.7.0

func (na *TCPAddr) Dial() (net.Conn, error)

Dial equivalent with net.Dial for this address.

func (*TCPAddr) Listen added in v0.7.0

func (na *TCPAddr) Listen() (net.Listener, error)

Listen equivalent with net.Listen for this address.

Jump to

Keyboard shortcuts

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