Documentation
¶
Overview ¶
Package http is a pgSCV http helper
Package http is a pgSCV http helper
Index ¶
Constants ¶
View Source
const ( // Code 200 StatusOK = http.StatusOK // Code 400 StatusBadRequest = http.StatusBadRequest StatusUnauthorized = http.StatusUnauthorized // Code 404 StatusNotFound = http.StatusNotFound )
Status code
Variables ¶
This section is empty.
Functions ¶
func TestFileServer ¶
TestFileServer create http test server
Types ¶
type AuthConfig ¶
type AuthConfig struct {
EnableAuth bool // flag tells about authentication should be enabled
Username string `yaml:"username"` // username used for basic authentication
Password string `yaml:"password"` // password used for basic authentication
EnableTLS bool // flag tells about TLS should be enabled
Keyfile string `yaml:"keyfile"` // path to key file
Certfile string `yaml:"certfile"` // path to certificate file
}
AuthConfig defines configuration settings for authentication.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines local wrapper on standard http.Client.
func (*Client) Do ¶
Do wraps a standard http.Do method which sends an HTTP request and returns an HTTP response.
func (*Client) EnableTLSInsecure ¶
func (cl *Client) EnableTLSInsecure()
EnableTLSInsecure enables insecure TLS transport for HTTP client.
type ClientConfig ¶
ClientConfig defines initial configuration when creating Client.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server defines HTTP server.
func NewServer ¶
func NewServer(cfg ServerConfig, handlerMetrics func(http.ResponseWriter, *http.Request), targetsMetrics func(http.ResponseWriter, *http.Request), ) *Server
NewServer creates new HTTP server instance.
type ServerConfig ¶
type ServerConfig struct {
Addr string
AuthConfig
}
ServerConfig defines HTTP server configuration.
Click to show internal directories.
Click to hide internal directories.