mod_http

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpModule

func NewHttpModule(ctx *js.JSEnv) interface{}

func NewHttpServing

func NewHttpServing() *http_access_log

Types

type HttpModule

type HttpModule struct{}

func (*HttpModule) CreateServer

func (m *HttpModule) CreateServer(jsCallback *js.EcmaObject, isFastCGI bool) (*HttpServer, error)

func (*HttpModule) Request

func (m *HttpModule) Request(options map[string]interface{}, jsCallback *js.EcmaObject) (*reqResult, error)

type HttpServer

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

func CreateHttpServer

func CreateHttpServer(jsCallback *js.EcmaObject, isFastCGI bool) *HttpServer

func (*HttpServer) Close

func (s *HttpServer) Close()

func (*HttpServer) Listen

func (s *HttpServer) Listen(port int, hostname string) error

type JSRequest

type JSRequest struct {
	Method      string
	Uri         string
	Path        string
	HttpVersion string
	Headers     map[string][]string
	Host        string
	RemoteAddr  string
	Auth        string
	RawQuery    string
	Hash        string
	// contains filtered or unexported fields
}

func (*JSRequest) GetLocalTime

func (req *JSRequest) GetLocalTime() string

func (*JSRequest) Param

func (req *JSRequest) Param(key string) string

func (*JSRequest) ParseParams

func (req *JSRequest) ParseParams() (map[string][]string, error)

func (*JSRequest) ReadBody

func (req *JSRequest) ReadBody() ([]byte, error)

type JSResponse

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

func (*JSResponse) End

func (resp *JSResponse) End(data []byte, encoding string)

func (*JSResponse) SetHeader

func (resp *JSResponse) SetHeader(key string, value interface{})

func (*JSResponse) Write

func (resp *JSResponse) Write(chunk []byte, encoding string)

func (*JSResponse) WriteHead

func (resp *JSResponse) WriteHead(statusCode int, headers map[string]interface{})

Jump to

Keyboard shortcuts

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