pkg

package
v0.0.0-...-bf444b6 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefault

func GetDefault[T comparable](value, fallback T) T

GetDefault returns the value if it is not the zero value of the type, otherwise it returns the fallback.

func GetDefaultPtr

func GetDefaultPtr[T any](value *T, fallback T) T

GetDefaultPtr returns the value if it is not nil, otherwise it returns the fallback.

Types

type CtxKey

type CtxKey string

CtxKey is the type alias for the context key.

const (
	CtxKeyUserID CtxKey = "userID" // ID of the user who made the request
	CtxKeyLogger CtxKey = "logger" // request-scoped logger
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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