parse

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package parse contains functions that can be used in the setup code for plugins.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoNameservers = errors.New("no nameservers found")

ErrNoNameservers is returned by HostPortOrFile if no servers can be parsed.

Functions

func HostPort

func HostPort(s, defaultPort string) (string, error)

HostPort will check if the host part is a valid IP address, if the IP address is valid, but no port is found, defaultPort is added.

func HostPortOrFile

func HostPortOrFile(s ...string) ([]string, error)

HostPortOrFile parses the strings in s, each string can either be a address, [scheme://]address:port or a filename. The address part is checked and in case of filename a resolv.conf like file is (assumed) and parsed and the nameservers found are returned.

func TransferIn

func TransferIn(c *caddy.Controller) (froms []string, err error)

TransferIn parses transfer statements: 'transfer from [address...]'.

func Transport

func Transport(s string) (trans string, addr string)

Transport returns the transport defined in s and a string where the transport prefix is removed (if there was any). If no transport is defined we default to TransportDNS

Types

This section is empty.

Jump to

Keyboard shortcuts

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