...

Package address

import "go.mongodb.org/mongo-driver/mongo/address"
Overview
Index

Overview ▾

Package address provides structured representations of network addresses.

type Address

Address is a network address. It can either be an IP address or a DNS name.

type Address string

func (Address) Canonicalize

func (a Address) Canonicalize() Address

Canonicalize creates a canonicalized address.

func (Address) Network

func (a Address) Network() string

Network is the network protocol for this address. In most cases this will be "tcp" or "unix".

func (Address) String

func (a Address) String() string

String is the canonical version of this address, e.g. localhost:27017, 1.2.3.4:27017, example.com:27017.