httputils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHighLoadClient

func NewHighLoadClient(requestTimeout time.Duration) http.Client

Types

type HTTPClient

type HTTPClient interface {
	Get(url string) (resp *http.Response, err error)
	Do(req *http.Request) (*http.Response, error)
	Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
	PostForm(url string, data url.Values) (resp *http.Response, err error)
	Head(url string) (resp *http.Response, err error)
	CloseIdleConnections()
}

type HTTPHandler

type HTTPHandler interface {
	ServeHTTP(http.ResponseWriter, *http.Request)
}

type HTTPServer

type HTTPServer interface {
	Close() error
	Shutdown(ctx context.Context) error
	RegisterOnShutdown(f func())
	ListenAndServe() error
	Serve(l net.Listener) error
	ServeTLS(l net.Listener, certFile string, keyFile string) error
	SetKeepAlivesEnabled(v bool)
	ListenAndServeTLS(certFile string, keyFile string) error
}

type Server

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

func NewServer

func NewServer(name, port string, handler http.Handler) (*Server, error)

func (*Server) Addr

func (s *Server) Addr() net.Addr

func (*Server) Run

func (s *Server) Run(ctx context.Context)

type ServerConfig

type ServerConfig struct {
	Port string `mapstructure:"port"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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