net

package module
v0.42.10 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 8 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 NewConnWithCloser

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

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 ConnWithCloser

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

func (*ConnWithCloser) Close

func (s *ConnWithCloser) Close() error

func (*ConnWithCloser) LocalAddr

func (s *ConnWithCloser) LocalAddr() net.Addr

func (*ConnWithCloser) NetConn

func (s *ConnWithCloser) NetConn() net.Conn

func (*ConnWithCloser) Read

func (s *ConnWithCloser) Read(b []byte) (int, error)

func (*ConnWithCloser) RemoteAddr

func (s *ConnWithCloser) RemoteAddr() net.Addr

func (*ConnWithCloser) SetDeadline

func (s *ConnWithCloser) SetDeadline(t time.Time) error

func (*ConnWithCloser) SetReadDeadline

func (s *ConnWithCloser) SetReadDeadline(t time.Time) error

func (*ConnWithCloser) SetWriteDeadline

func (s *ConnWithCloser) SetWriteDeadline(t time.Time) error

func (*ConnWithCloser) Write

func (s *ConnWithCloser) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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