net

package module
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

net/http/auth

Create BasicAuthHandler and populate with BasicAuthMap

var handler http.Handler

server := dch.NewServerWithLogger(serverConfig, logger)

authMap := dca.BasicAuthMap{}
authMap.AddUserWithPlainPassword("userA", "passwordA")

server.AddHandler("/status", dca.NewBasicAuthHandler(handler, authMap))

```§

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrPortDetailsFromString

func AddrPortDetailsFromString(addrPort string) (netip.AddrPort, string, error)

func ConvertAddrToIP

func ConvertAddrToIP(addr netip.Addr) net.IP

func ExpandStringTemplate

func ExpandStringTemplate(templateString string, data any) (string, error)

func FindInterfaceForAddr

func FindInterfaceForAddr(a netip.Addr) (string, error)

func FindInterfaceForIP

func FindInterfaceForIP(ip net.IP) (string, error)

func TCPAddrFromURL

func TCPAddrFromURL(url *url.URL) (string, error)

func TCPPortFromURL

func TCPPortFromURL(url *url.URL) (string, error)

returns string because that's what url.URL.Port() does

Types

type DoneConn added in v0.44.0

type DoneConn interface {
	net.Conn
	Done() <-chan struct{}
	Closed() bool
}

func NewConnWithCloser

func NewConnWithCloser(c net.Conn, closer func(net.Conn)) DoneConn

func NewDoneConn added in v0.44.0

func NewDoneConn(c net.Conn) DoneConn

type RawConn added in v0.44.0

type RawConn interface {
	NetConn() net.Conn
}

Jump to

Keyboard shortcuts

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