app

package
v0.0.0-...-839d480 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

README

micro/app


app provides an HTTP server.

Documentation


package app // import "bitbucket.org/_mikey/micro/app"

Package app provides an HTTP server

TYPES

type App struct {
	*http.Server

	// Has unexported fields.
}
    App defines the base application

func New(cfg Config) *App
    New returns a new *App

func (app *App) Run() (err error)
    Run starts an HTTP server

func (app *App) RunTLS(certFile, keyFile string) (err error)
    RunTLS starts an HTTPS server

type Config struct {
	Addr     string
	Handler  http.Handler
	ErrorLog *log.Logger

	TLSConfig *tls.Config
}
    Config defines the server configuration

Tests


go test -v -test.count 5
=== RUN   TestNewAppAndRun
--- PASS: TestNewAppAndRun (0.00s)
=== RUN   TestNewAppAndRun
--- PASS: TestNewAppAndRun (0.00s)
=== RUN   TestNewAppAndRun
--- PASS: TestNewAppAndRun (0.00s)
=== RUN   TestNewAppAndRun
--- PASS: TestNewAppAndRun (0.00s)
=== RUN   TestNewAppAndRun
--- PASS: TestNewAppAndRun (0.00s)
PASS
ok  	bitbucket.org/_mikey/micro/app	0.005s

Documentation

Overview

Package app provides an HTTP server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App defines the base application

func New

func New(cfg Config) *App

New returns a new *App

func (*App) Run

func (app *App) Run() (err error)

Run starts an HTTP server

func (*App) RunTLS

func (app *App) RunTLS(certFile, keyFile string) (err error)

RunTLS starts an HTTPS server

type Config

type Config struct {
	Addr     string
	Handler  http.Handler
	ErrorLog *log.Logger

	TLSConfig *tls.Config
}

Config defines the server configuration

Jump to

Keyboard shortcuts

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