runtimeconfig

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package runtimeconfig extracts trusted system-level configuration forwarded by ProcessModule Core to module API requests.

Module HTTP ports must not be exposed directly to untrusted clients because runtime configuration headers are trusted only when requests come through Core.

Index

Constants

View Source
const (
	HeaderTimezone     = "X-ProcessModule-Timezone"
	HeaderCurrencyCode = "X-ProcessModule-Currency-Code"
)

Variables

This section is empty.

Functions

func DateAt added in v0.9.0

func DateAt(ctx context.Context, instant time.Time) time.Time

DateAt returns a calendar date, represented at UTC midnight for date-only APIs.

func Location added in v0.9.0

func Location(ctx context.Context) *time.Location

Location requires a context initialized by Require or WithTimezone.

func ParseTimezone added in v0.9.0

func ParseTimezone(name string) (*time.Location, error)

ParseTimezone accepts stable IANA names, independent of the host timezone.

func Require

func Require() echo.MiddlewareFunc

Require validates trusted runtime configuration and stores it in the Echo request context.

func Today added in v0.9.0

func Today(ctx context.Context) time.Time

func WithTimezone added in v0.9.0

func WithTimezone(ctx context.Context, location *time.Location) context.Context

WithTimezone supplies the explicit system timezone for a request or background job.

Types

type Config

type Config struct {
	Currency money.Currency
	Timezone *time.Location
}

func From

func From(c *echo.Context) (Config, bool)

Jump to

Keyboard shortcuts

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