http

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, r *http.Request, err error)

Error prints, and optionally logs, an error message.

func ErrorStatusCode

func ErrorStatusCode(code string) int

func ListenAndServeTLSRedirect

func ListenAndServeTLSRedirect(domain string) error

ListenAndServeTLSRedirect runs an HTTP server on port 80 to redirect users to the TLS-enabled port 443 server.

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type Server

type Server struct {
	Config midas.Config

	SiteServices map[string]func(site midas.Site) (midas.SiteService, error)
	// contains filtered or unexported fields
}

func NewServer

func NewServer(logLevel string, testing bool) *Server

func (*Server) Close

func (s *Server) Close() error

Close gracefully shut downs the server

func (*Server) HandleAstroRebuild added in v1.3.0

func (s *Server) HandleAstroRebuild(w http.ResponseWriter, r *http.Request)

func (*Server) HandleHugoRebuild

func (s *Server) HandleHugoRebuild(w http.ResponseWriter, r *http.Request)

func (*Server) HandleSystemCommit

func (s *Server) HandleSystemCommit(w http.ResponseWriter, r *http.Request)

func (*Server) HandleSystemVersion

func (s *Server) HandleSystemVersion(w http.ResponseWriter, r *http.Request)

func (*Server) Open

func (s *Server) Open() error

Open validates server options and begins listening on the bind address.

func (*Server) Port

func (s *Server) Port() int

Port returns the TCP port for the running server.

func (*Server) Scheme

func (s *Server) Scheme() string

Scheme returns the URL scheme for the server.

func (*Server) URL

func (s *Server) URL() string

func (*Server) UseTLS

func (s *Server) UseTLS() bool

UseTLS returns true if the certificate and key file are specified.

type StrapiToAstroHandler added in v1.3.0

type StrapiToAstroHandler struct {
	AstroSite midas.SiteService
	Payload   midas.Payload
	// contains filtered or unexported fields
}

func (StrapiToAstroHandler) Handle added in v1.3.0

type StrapiToHugoHandler

type StrapiToHugoHandler struct {
	HugoSite midas.SiteService
	Payload  midas.Payload
	// contains filtered or unexported fields
}

func (StrapiToHugoHandler) Handle

type SystemResponse

type SystemResponse struct {
	Data string `json:"data"`
}

Jump to

Keyboard shortcuts

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