http

package
v0.0.0-...-c277624 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(username, passwd string) string

func CanonicalHost

func CanonicalHost(host string) (string, error)

canonicalHost strips port from host if present and returns the canonicalized host name.

func HttpJsonGet

func HttpJsonGet(requestUrl string, headers map[string]string) (buf []byte, err error)

func HttpJsonPost

func HttpJsonPost(requestUrl string, body []byte, headers map[string]string) (buf []byte, err error)

func OkResponse

func OkResponse() *http.Response

func ParseBasicAuth

func ParseBasicAuth(auth string) (username, password string, ok bool)

func ProxyUnauthorizedResponse

func ProxyUnauthorizedResponse() *http.Response

Types

type RouterRegisterHelper

type RouterRegisterHelper struct {
	Router         *mux.Router
	AssetsFS       http.FileSystem
	AuthMiddleware mux.MiddlewareFunc
}

type Server

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

func NewServer

func NewServer(cfg v1.WebServerConfig) (*Server, error)

func (*Server) Address

func (s *Server) Address() string

func (*Server) Close

func (s *Server) Close() error

func (*Server) RouteRegister

func (s *Server) RouteRegister(register func(helper *RouterRegisterHelper))

func (*Server) Run

func (s *Server) Run() error

Jump to

Keyboard shortcuts

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