internal

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinDefaultPort added in v1.1.0

func JoinDefaultPort(address string, port string) string

JoinDefaultPort appends ":<port>" iff the address does not already contain a port.

func ListUsersWithHomeSubdir added in v1.3.0

func ListUsersWithHomeSubdir(subdir string, required_perms os.FileMode) ([]string, error)

ListUsersWithHomeSubdir provides a list of user names on the current host.

The users returned will only be those with a specifically named subdirectory of their home dir, which has the given permission bits.

Types

type PathTree

type PathTree[V any] struct {
	// contains filtered or unexported fields
}

func (*PathTree[V]) Add

func (pt *PathTree[V]) Add(pattern string, value V)

func (PathTree[V]) Match

func (pt PathTree[V]) Match(path string) (*V, map[string]string)

func (PathTree[V]) Routes

func (pt PathTree[V]) Routes() []Route[V]

type Route

type Route[V any] struct {
	Pattern string
	Value   V
}

type Server

type Server struct {
	Ctx         context.Context
	Cancel      context.CancelFunc
	Wg          *sync.WaitGroup
	Listener    net.Listener
	HandleConn  connHandler
	ErrorLog    logger
	Host        string
	NetworkAddr net.Addr
}

func NewServer

func NewServer(
	ctx context.Context,
	hostname string,
	network string,
	address string,
	errorLog logger,
	handleConn connHandler,
) (Server, error)

func (*Server) Address

func (s *Server) Address() string

func (*Server) Close

func (s *Server) Close()

func (*Server) Closed

func (s *Server) Closed() bool

func (*Server) Hostname

func (s *Server) Hostname() string

func (*Server) LogError

func (s *Server) LogError(keyvals ...any) error

func (*Server) Network

func (s *Server) Network() string

func (*Server) Port

func (s *Server) Port() string

func (*Server) Serve

func (s *Server) Serve() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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