server

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Type       Type
	Path       string
	Host       string
	Subdomain  string
	TLS        TLSRequest
	Port       int
	Expose     bool
	CORS       bool
	Launch     bool
	Auth       string
	DisableTUI bool
}

func (*Configuration) WantsAutoTLS

func (r *Configuration) WantsAutoTLS() bool

func (*Configuration) WantsTLS

func (r *Configuration) WantsTLS() bool

type Handler

type Handler interface {
	http.Handler
}

func FileServer

func FileServer(root http.FileSystem) Handler

type Output added in v0.4.2

type Output interface {
	Init(location string, addresses []string)
	Write(request *Request)
}

func NewLogOutput added in v0.4.2

func NewLogOutput() Output

func NewTuiOutput added in v0.4.2

func NewTuiOutput() Output

type Request added in v0.4.2

type Request struct {
	RemoteAddress string
	Url           string
	Method        string
	Status        int
	Time          *time.Duration
	Body          *io.ReadCloser
	ContentType   string
	ContentLength uint64
}

type RequestHandler

type RequestHandler interface {
	Handle(h http.Handler) http.Handler
}

type Requests added in v0.4.2

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

func NewRequestManager added in v0.4.2

func NewRequestManager() *Requests

func (*Requests) Add added in v0.4.2

func (m *Requests) Add(request *Request)

func (*Requests) Find added in v0.4.2

func (m *Requests) Find(url string) *Request

type Servant

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

func New

func New(config Configuration) *Servant

func (*Servant) Start

func (s *Servant) Start()

type Server

type Server interface {
	Init(handler RequestHandler, httpHandler http.Handler) (*http.ServeMux, net.Listener, []string, error)
	Start(server *http.Server, listener net.Listener) error
}

type TLSRequest

type TLSRequest struct {
	Auto     bool
	CertFile string
	KeyFile  string
}

type Type

type Type string
const (
	TypeLocal  Type = "local"
	TypeRemote Type = "remote"
)

Jump to

Keyboard shortcuts

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