cgi
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package cgi implements CGI (Common Gateway Interface) as specifiedinRFC 3875.
Note that using CGI means starting a new process to handle eachrequest, which is typically less efficient than using along-running server. This package is intended primarily forcompatibility with existing systems.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcRequest¶
Request returns the HTTP request as represented in the currentenvironment. This assumes the current program is being runby a web server in a CGI environment.The returned Request's Body is populated, if applicable.
funcRequestFromMap¶
RequestFromMap creates anhttp.Request from CGI variables.The returned Request's Body field is not populated.
Types¶
typeHandler¶
type Handler struct {Pathstring// path to the CGI executableRootstring// root URI prefix of handler or empty for "/"// Dir specifies the CGI executable's working directory.// If Dir is empty, the base directory of Path is used.// If Path has no base directory, the current working// directory is used.DirstringEnv []string// extra environment variables to set, if any, as "key=value"InheritEnv []string// environment variables to inherit from host, as "key"Logger *log.Logger// optional log for errors or nil to use log.PrintArgs []string// optional arguments to pass to child processStderrio.Writer// optional stderr for the child process; nil means os.Stderr// PathLocationHandler specifies the root http Handler that// should handle internal redirects when the CGI process// returns a Location header value starting with a "/", as// specified inRFC 3875 § 6.3.2. This will likely be// http.DefaultServeMux.//// If nil, a CGI response with a local URI path is instead sent// back to the client and not redirected internally.PathLocationHandlerhttp.Handler}
Handler runs an executable in a subprocess with a CGI environment.