httpserve

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: MIT Imports: 24 Imported by: 0

README

httpServe

Simple tool that serves a folder and render some specific files

  • Markdown (any .md) (it also renders some dot notation graphs)
  • Wasm (if a folder contains a main.go file)
  • dot files using http://url/file.dot?f=png

Watches for resources and tell browser to reload if any of the listen file changes

split

Usage:

go get github.com/stdiopt/httpserve/cmd/httpServe
# with $GOPATH/bin in  $PATH

httpServe

Documentation

Overview

Package httpserve serves files, markdown, wasm

Index

Constants

View Source
const (
	//Version contains version of the package
	Version = "v0.0.1-4-g3538cfb - built: 2021-01-19 13:58:03 UTC"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogHelper

type LogHelper struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

LogHelper struct to handle write logs

func (*LogHelper) Hijack

func (l *LogHelper) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijack hihack wrapper for hijacker users (websocket?)

func (*LogHelper) WriteHeader

func (l *LogHelper) WriteHeader(code int)

WriteHeader hijack write header to track httpStatus

type Middleware

type Middleware func(http.Handler) http.Handler

Middleware type for middleware chain

func Logger

func Logger(log *log.Logger) Middleware

Logger middleware

type Middlewares

type Middlewares []Middleware

Middlewares chain

func (Middlewares) Apply

func (mws Middlewares) Apply(next http.Handler) http.Handler

Apply middlewares and return the final handler

type Options

type Options struct {
	FlagMdCSS string
}

Options for httpserve

type Server

type Server struct {
	http.Handler
	// contains filtered or unexported fields
}

Server thing

func New

func New(opt Options) (*Server, error)

New register routes

type WasmHandler added in v0.0.2

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

Directories

Path Synopsis
Package assets provides static assets for rich content
Package assets provides static assets for rich content
cmd
example

Jump to

Keyboard shortcuts

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