http

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName string = "http-server"
)

Variables

View Source
var (
	ErrUnknownMethod error = fmt.Errorf("unknown http method")
	ErrUnknownModule       = fmt.Errorf("module is not the %s module", ModuleName)
)

Functions

func WithRequestLogger deprecated

func WithRequestLogger() modules.Option

Deprecated: this option has no effect, the module is always logging and setting the request logger, regardless if this options is used or not and will be removed in future.

func WithRoute

func WithRoute(route Route) modules.Option

func WithServerPort

func WithServerPort(port int) modules.Option

Types

type Module

type Module struct {
	modules.Base
	// contains filtered or unexported fields
}

func New

func New() *Module

func (*Module) Configure

func (m *Module) Configure(opts ...modules.Option) error

func (*Module) RegisterRoute

func (m *Module) RegisterRoute(route Route) error

func (*Module) RegisterRoutes

func (m *Module) RegisterRoutes(routes ...Route) error

func (*Module) Router

func (m *Module) Router() *gin.Engine

func (*Module) Shutdown

func (m *Module) Shutdown() error

func (*Module) Start

func (m *Module) Start() error

type Route

type Route struct {
	Group      string
	Handler    gin.HandlerFunc
	URI        string
	HTTPMethod string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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