http

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package http provides bindings for Go's net/http package.

Package http provides HTTP server bindings for TypeGo.

Index

Constants

This section is empty.

Variables

View Source
var HttpTypes []byte

Functions

func Register

func Register(vm *goja.Runtime, el *eventloop.EventLoop)

Register injects the http functions into the runtime

Types

type Module

type Module struct{}

Module implements the go:net/http package bindings.

func (*Module) Get

func (h *Module) Get(vm *goja.Runtime) func(goja.FunctionCall) goja.Value

Get maps to http.Get

type Server

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

Server wraps http.Server for TypeGo

func NewServer

func NewServer(vm *goja.Runtime, el *eventloop.EventLoop) *Server

NewServer creates a new TypeGo HTTP server

func (*Server) Close

func (s *Server) Close(timeout time.Duration) error

Close shuts down the server gracefully

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string, handler goja.Callable) error

ListenAndServe starts the HTTP server with a JS handler

Jump to

Keyboard shortcuts

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