zeroweb

package module
v0.0.0-...-744194d Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

README

go-zeroweb

GoDoc Go Report Card Codacy Badge Maintainability Coverage Build Status FOSSA Status

WebFramework Stack written in golang optimized for lowest latency and high throughput

Components

Component Description License
Config Viper can take configs from various formats and sources and supports reload triggers MIT License
DB (Postgres) Go-PG is a database driver for Postgres/Cockroachdb including a Connectionpool and prepared statements BSD 2-Clause License
Log zerolog is a static typed json logger with nearly no allocations MIT License
Router fasthttprouter BSD 3-Clause "Revised" License
Server fasthttp is a http library MIT License
View jet is a zero allocation tempalte engine with jinja2 familiar syntax Apache License 2.0

Why these component?

Component Description
Config To provide a simple way for handling configurations and reloads on configchange Viper is directly included. Viper is not optimized for speed but for comfortability
DB Postgres is mature, Cockroachdb is extremly scaleable but both speak the postgres protocol, this provides an common sql syntax with the possibility to scale. GO-PG ships with an easy to use ORM capable of prepared statements and batches
Log Fastest Logger by benchmark
Router The Router is a Trie Based router with a Ο(|s|) Complexity with s being the length of the string
Server Fasthttp is the fastest http-server for golang benchmark and uses an optimized flate and gzip implementation compress
View jinja2 familiar Syntax And fastest templating without precompilation to golang benchmark

License

FOSSA Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Zeroweb

type Zeroweb struct {
	Config *viper.Viper
	DB     *pg.DB
	Log    *zerolog.Logger
	Router *fasthttprouter.Router
	Server *fasthttp.Server
	View   *jet.Set
}

func New

func New(config *viper.Viper) *Zeroweb

New takes a viper config and returns a half initialized Zeroweb. After adding some Routes start with it with Serve()

func (*Zeroweb) Reload

func (zeroweb *Zeroweb) Reload() error

func (*Zeroweb) Serve

func (zeroweb *Zeroweb) Serve() error

Jump to

Keyboard shortcuts

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