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: 0

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