endpoint

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EP

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

func MustParse

func MustParse(endpoint string) EP

MustParse() is similar to Parse(), but it panics if endpoint is invalid and can't be parsed. useful primarily for tests and global "consts" inits.

func Parse

func Parse(endpoint string) (EP, error)

Parse() is like ParseStricter(), but it disregards spaces before and after the endpoint string.

func ParseIP

func ParseIP(endpoint string) (EP, error)

ParseIP() is akin to Parse, but it only accepts valid IPv4/IPv6 addresses as hosts.

func ParseStricter

func ParseStricter(endpoint string) (EP, error)

func (EP) Host

func (ep EP) Host() string

func (EP) IsValid

func (ep EP) IsValid() bool

func (EP) MarshalJSON

func (ep EP) MarshalJSON() ([]byte, error)

func (EP) Port

func (ep EP) Port() uint16

func (EP) PortString

func (ep EP) PortString() string

func (EP) String

func (ep EP) String() string

type Slice

type Slice []EP

func MustParseCSV

func MustParseCSV(endpoints string) Slice

func ParseCSV

func ParseCSV(endpoints string) (Slice, error)

ParseCSV() parses a string containing comma-separated list of target endpoints, validates them syntactically, and returns a slice of EP structs. it does NOT attempt to resolve the names present in the endpoints nor does it try to connect to any of the targets. `targets` must be in a format:

<host>:<port>[,<host>:<port>...]

func ParseSlice

func ParseSlice(targets []string) (Slice, error)

func ParseSliceIP

func ParseSliceIP(targets []string) (Slice, error)

ParseSliceIP() is akin to ParseSlice, but it only accepts a valid IPv4/IPv6 addresses as hosts.

func (Slice) Clone

func (eps Slice) Clone() Slice

func (Slice) Equal

func (eps Slice) Equal(rhs Slice) bool

func (Slice) IsValid

func (eps Slice) IsValid() bool

func (Slice) Len

func (eps Slice) Len() int

for sort.Interface:

func (Slice) Less

func (eps Slice) Less(i, j int) bool

func (Slice) String

func (eps Slice) String() string

func (Slice) Swap

func (eps Slice) Swap(i, j int)

Jump to

Keyboard shortcuts

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