github.com/nbari/violetear

violetear

Package violetear - HTTP router Basic example: package main import ( "fmt" "github.com/nbari/violetear" "log" "net/http" ) func catchAll(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, r.URL.Path[1:]) } func helloWorld(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, r.URL.Path[1:]) } func handleUUID(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, r.URL.Path[1:]) } func main() { router := violetear.New() router.LogRequests = true router.RequestID = "REQUEST_LOG_ID" router.AddRegex(":uuid", `[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`) router.HandleFunc("*", catchAll) router.HandleFunc("/hello", helloWorld, "GET,HEAD") router.HandleFunc("/root/:uuid/item", handleUUID, "POST,PUT") srv := &http.Server{ Addr: ":8080", Handler: router, ReadTimeout: 5 * time.Second, WriteTimeout: 7 * time.Second, MaxHeaderBytes: 1 << 20, } log.Fatal(srv.ListenAndServe()) }

49

Decision Signals

Health score 49/100, confidence 80/100.

Caution
Maintenance 15
Adoption 40
Security 92
Maturity 55
Developer DX 83
Confidence 80

Install

go get github.com/nbari/violetear

Package Data

updated May 31, 2026
Latest versionv0.0.0-20210524103009-ce83b52538c9
Imported by87 packages
Stars0
Forks0
Last activity5 years ago
Latest releaseUnknown
LicenseUnknown
Known vuln records0

API Surface

41 symbols
SymbolKindSynopsis
MethodHandler Type type MethodHandler struct{ ... }
MethodHandler.Handler Field Handler http.Handler
MethodHandler.Method Field Method string
Params Type type Params map[string]interface{}
Params.Add Method func (p Params) Add(k, v string)
ResponseWriter Type type ResponseWriter struct{ ... }
NewResponseWriter Function func NewResponseWriter(w http.ResponseWriter, rid string) *ResponseWriter
ResponseWriter.RequestID Method func (w *ResponseWriter) RequestID() string
ResponseWriter.RequestTime Method func (w *ResponseWriter) RequestTime() string
ResponseWriter.Size Method func (w *ResponseWriter) Size() int
ResponseWriter.Status Method func (w *ResponseWriter) Status() int
ResponseWriter.Write Method func (w *ResponseWriter) Write(data []byte) (int, error)

Maintained Alternatives

limited recent repository activity

#1 Google UUID

Package uuid generates and inspects UUIDs.

Go UUID Libraries 6.1K stars 0 imported-by 80% confidence
70

Similar Packages

Go UUID Libraries

#1 Google UUID

Package uuid generates and inspects UUIDs.

Go UUID Libraries 6.1K stars 0 imported-by 80% confidence
70

#2 uuid

Package uuid provides implementations of the Universally Unique Identifier (UUID), as specified in RFC-4122 and the Peabody RFC Draft (revision 03).

Go UUID Libraries 0 stars 22.7K imported-by 80% confidence
58

#3 go.uuid

Package uuid provides implementation of Universally Unique Identifier (UUID).

Go UUID Libraries 0 stars 32.8K imported-by 75% confidence
57

#4 ksuid

K-Sortable Globally Unique IDs

Go UUID Libraries 0 stars 1.8K imported-by 75% confidence
54

#5 uuid

Package uuid implements generation and manipulation of UUIDs (v1 defined in RFC 4122).

Go UUID Libraries 0 stars 5 imported-by 80% confidence
46