ohm

package module
v0.0.0-...-08e2cd6 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

README

Ohm

Less resistance writing HTTP programs with Gos built in HTTP multiplexer and standard library.

Scope

Ohm aims to provide useful functions and middleware as well as examples and templates.
The content provided should follow common best practices, be adapted from other public work or reflect own experiences.

Always prefer simplicity and explicitness over "cleverness" and functionality.

Examples

The examples located in the _examples/ folder aim to implement at least the examples provided by the popular library chi.

When implementing an example, restrain from using other third party libraries. If you want to include an example and need a library, get in touch.

Current Examples
  • Hello World
Templates

The templates located in the _templates/ folder aim to provide copyable files, which are useful for multiple projects. The scope yet has to be decided upon.

Current Templates
  • Program Makefile
Libraries

Ohm aims to provide a list of high quality libraries for building HTTP servers. Instead of remembering your favourites, look them up add them to this list.

Documentation

Overview

Package ohm contains several auxiliary functions for writing web servers in Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(parent *http.ServeMux, pattern string, handler http.Handler)

Mount registers the handler for the given pattern on the parent router. If the given pattern conflicts, with one that is already registered, or is missing the suffix /, Mount panics.

Mount is supposed to be used with a net/http.ServeMux. Prefer net/http.ServeMux.Handle for other net/http.Handler.

func Route

func Route(parent *http.ServeMux, pattern string, fn func(mux *http.ServeMux))

Route allocates a new net/http.ServeMux and mounts it for the given pattern on the parent router. If the given pattern conflicts, with one that is already registered, or is missing the suffix /, Route panics.

Effectively, this is a short-hand call to Mount.

Types

This section is empty.

Directories

Path Synopsis
_examples

Jump to

Keyboard shortcuts

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