locale

package
v0.397.3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeLocation

func GetTimeLocation(ctx context.Context) (time.Location, error)

GetTimeLocation returns the time location set on the context, or error if none set

func HandleTimezoneHeader

func HandleTimezoneHeader(ctx context.Context, headers http.Header) (time.Location, error)

HandleTimezoneHeader will extract the time location from the Time-Zone header and set it on the context. The location will also be set as an attribute to the context's tracing span. If no header set, the location will default to UTC

func HasTimeLocation

func HasTimeLocation(ctx context.Context) bool

HasTimeLocation returns true if the context has a Time Location set

func WithTimeLocation

func WithTimeLocation(ctx context.Context, location time.Location) context.Context

WithTimeLocation sets the given time location on the context

Types

This section is empty.

Jump to

Keyboard shortcuts

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