http_server

package module
v0.0.0-...-d48828a Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 3 Imported by: 0

README

HTTP server

Table of Content

Examples

package main

import (
	"context"

	"entrlcom.dev/http-server"
)

func main() {
	ctx := context.Background()

	// HTTP server.
	httpServer := http_server.NewHTTPServer()
	httpServer.Addr = ""     // TODO: set address.
	httpServer.Handler = nil // TODO: set handler.

	if err := httpServer.ListenAndServe(); err != nil {
		// TODO: Handle error.
		return
	}

	// ...

	// Shutdown HTTP server.
	if err := httpServer.Shutdown(ctx); err != nil {
		// TODO: Handle error.
		return
	}

	// ...
}

License

MIT

Documentation

Index

Constants

View Source
const (
	DefaultIdleTimeout       = time.Minute * 2
	DefaultReadHeaderTimeout = DefaultReadTimeout
	DefaultReadTimeout       = time.Second * 5
	DefaultTLSMinVersion     = tls.VersionTLS13
	DefaultWriteTimeout      = time.Second * 5
)

Variables

This section is empty.

Functions

func NewDefaultCipherSuites

func NewDefaultCipherSuites() []uint16

func NewDefaultCurvePreferences

func NewDefaultCurvePreferences() []tls.CurveID

NewDefaultCurvePreferences — returns curves that have assembly implementations.

func NewDefaultHandler

func NewDefaultHandler() http.HandlerFunc

func NewHTTPServer

func NewHTTPServer() *http.Server

Types

This section is empty.

Jump to

Keyboard shortcuts

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