github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/net/http/cgi/child.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // このファイルは子プロセスの視点からCGIを実装しています。 6 7 package cgi 8 9 import ( 10 "github.com/shogo82148/std/net/http" 11 ) 12 13 // Request は現在の環境で表される HTTP リクエストを返します。 14 // この関数は、現在のプログラムが CGI 環境で実行されていることを前提としています。 15 // 適用される場合、返された Request の Body は取得されます。 16 func Request() (*http.Request, error) 17 18 // RequestFromMapはCGI変数から [http.Request] を作成します。 19 // 返されたRequestのBodyフィールドは入力されません。 20 func RequestFromMap(params map[string]string) (*http.Request, error) 21 22 // Serveは現在アクティブなCGIリクエストに提供された [Handler] を実行します。 23 // もし現在のCGI環境がない場合、エラーが返されます。提供されたハンドラーがnilの場合、[http.DefaultServeMux] が使用されます。 24 func Serve(handler http.Handler) error