web

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	Query(ctx context.Context, w io.Writer, q string) error
}

type Proto

type Proto func(context.Context, net.Conn) error

type Server

type Server struct {
	Agent Agent
	FS    http.FileSystem
}

func New

func New(a Agent) (*Server, error)

func (*Server) HandleConn

func (s *Server) HandleConn(ctx context.Context, c net.Conn) (err error)

func (*Server) HandleRequest

func (s *Server) HandleRequest(ctx context.Context, rw http.ResponseWriter, req *http.Request) (err error)

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, l net.Listener, proto Proto) (err error)

Jump to

Keyboard shortcuts

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