infra

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresConn

func NewPostgresConn() (*sql.DB, error)

Types

type Logger

type Logger interface {
	Info(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(msg string, args ...any)
	InfoContext(ctx context.Context, msg string, args ...any)
	WarnContext(ctx context.Context, msg string, args ...any)
	ErrorContext(ctx context.Context, msg string, args ...any)
}

type Middleware

type Middleware interface {
	http.Handler
	Wrap(http.Handler) http.Handler
}

type Server

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

func NewServer

func NewServer(opts ...ServerOpt) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

type ServerOpt

type ServerOpt func(*Server)

func WithAddr

func WithAddr(addr string) ServerOpt

func WithLogger

func WithLogger(logger Logger) ServerOpt

func WithMiddleware

func WithMiddleware(mw Middleware) ServerOpt

func WithRouter

func WithRouter(r router) ServerOpt

Jump to

Keyboard shortcuts

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