resthttp

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultOpt = Options{
		ListenAddr:         "localhost:8080",
		Realm:              "honey",
		ServerReadTimeout:  60 * time.Second,
		ServerWriteTimeout: 60 * time.Second,
		MaxHeaderBytes:     4096,
	}
)

Functions

This section is empty.

Types

type Options

type Options struct {
	ListenAddr         string        // Port to listen on
	BaseURL            string        // prefix to strip from URLs
	ServerReadTimeout  time.Duration // Timeout for server reading data
	ServerWriteTimeout time.Duration // Timeout for server writing data
	MaxHeaderBytes     int           // Maximum size of request header
	SslCert            string        // SSL PEM key (concatenation of certificate and CA certificate)
	SslKey             string        // SSL PEM Private key
	ClientCA           string        // Client certificate authority to verify clients with
	Realm              string        // realm for authentication
	BasicUser          string        // single username for basic auth
	BasicPass          string        // password for BasicUser
	UI                 bool          // enable ui
}

type Server

type Server struct {
	Opt *Options
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opt *Options) *Server

NewServer _

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) URL

func (s *Server) URL() string

URL returns the serving address of this server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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