router

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

guided by github.com/go-chi/chi/_examples/logging

Package router based on Chi server boilerplate generated by https://github.com/deepmap/oapi-codegen guided by oapi-codegen/examples/petstore-expanded/chi/petstore.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStructuredLogger

func NewStructuredLogger(logger *logrus.Logger) func(next http.Handler) http.Handler

Types

type AppRouter

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

func NewAppRouter

func NewAppRouter(ctx context.Context, a *app.App, cfg *config.RouterConfig) (*AppRouter, error)

func (*AppRouter) CreateShortUrl

func (art *AppRouter) CreateShortUrl(w http.ResponseWriter, r *http.Request)

func (*AppRouter) GetMainPage

func (art *AppRouter) GetMainPage(w http.ResponseWriter, r *http.Request)

func (*AppRouter) GetOpenAPI

func (art *AppRouter) GetOpenAPI(w http.ResponseWriter, r *http.Request)

func (*AppRouter) GetShortUrlInfo

func (art *AppRouter) GetShortUrlInfo(w http.ResponseWriter, r *http.Request, token string)

func (*AppRouter) HitShortUrl

func (art *AppRouter) HitShortUrl(w http.ResponseWriter, r *http.Request, token string)

type StructuredLogger

type StructuredLogger struct {
	Logger *logrus.Logger
}

func (*StructuredLogger) NewLogEntry

func (l *StructuredLogger) NewLogEntry(r *http.Request) middleware.LogEntry

type StructuredLoggerEntry

type StructuredLoggerEntry struct {
	Logger logrus.FieldLogger
}

func (*StructuredLoggerEntry) Panic

func (l *StructuredLoggerEntry) Panic(v interface{}, stack []byte)

func (*StructuredLoggerEntry) Write

func (l *StructuredLoggerEntry) Write(status, bytes int, header http.Header, elapsed time.Duration, extra interface{})

Jump to

Keyboard shortcuts

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