utils

package
v0.0.0-...-a759d6a Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode[T any](r *http.Request) (T, error)

JSON decoder for HTTP requests

func Encode

func Encode[T any](w http.ResponseWriter, r *http.Request, status int, v T) error

JSON encoder for HTTP responses

Types

type Config

type Config struct {
	ServerAddr string
	LogLevel   slog.Level
	DBUser     string
	DBPass     string
	DBHost     string
	DBPort     int
	DBDatabase string
}

func GetConfig

func GetConfig() *Config

Jump to

Keyboard shortcuts

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