ez

package module
v0.0.0-...-197dda7 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 10 Imported by: 0

README

ez

The Go framework that focus on development experience, for those who think Go is already fast enough for their needs and don't care too much about saving a ms or two but would like a better development experience around developing a Web API in Go.

Great for prototyping, for services that use an event-based architecture on the background and most of the requests are asynchronous.

Getting involved

Send the author a message, preferably on twitter, or interact through issues.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocsGenerator

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

func (*DocsGenerator) GenerateDocs

func (g *DocsGenerator) GenerateDocs()

func (*DocsGenerator) GenerateDocsForRoute

func (g *DocsGenerator) GenerateDocsForRoute(route Route)

func (*DocsGenerator) GenerateOpenAPIFiles

func (g *DocsGenerator) GenerateOpenAPIFiles()

type EZServer

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

func New

func New(s *http.Server) *EZServer

func (*EZServer) GenerateDocs

func (ez *EZServer) GenerateDocs()

func (*EZServer) GetRoutes

func (ez *EZServer) GetRoutes() []Route

func (*EZServer) HandleFunc

func (ez *EZServer) HandleFunc(route Route) func(rw http.ResponseWriter, r *http.Request)

func (*EZServer) ListenAndServe

func (ez *EZServer) ListenAndServe()

func (*EZServer) NotFound

func (ez *EZServer) NotFound(rw http.ResponseWriter, r *http.Request)

func (*EZServer) RegisterRoute

func (ez *EZServer) RegisterRoute(route Route)

type OpenAPIDocs

type OpenAPIDocs struct {
	Components openapi3.Components `json:"components,omitempty" yaml:"components,omitempty"`
	Paths      openapi3.Paths      `json:"paths,omitempty" yaml:"paths,omitempty"`
}

type Route

type Route struct {
	Handler  func(http.ResponseWriter, *http.Request)
	Pattern  string
	Method   []string // http.Method
	Request  interface{}
	Response interface{}
}

type RouteKeyType

type RouteKeyType string
const (
	RouteKey RouteKeyType = "request"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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