params

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package params holds the shared query-parameter parsing used by all three framework adapters, so request handling stays identical across gin, echo, and fiber.

Index

Constants

View Source
const DefaultFrom = "USD"

DefaultFrom is the base currency used when `from` is omitted, matching the client default in the canonical spec.

Variables

View Source
var ErrInvalidAmount = errors.New("invalid amount parameter")

ErrInvalidAmount is returned when the amount query parameter is not a parseable number.

View Source
var ErrMissingParam = errors.New("missing required query parameter")

ErrMissingParam is returned when a required query parameter is absent.

Functions

func Convert

func Convert(from, to, amount string) (fromCode, toCode string, amt float64, err error)

Convert parses parameters for the /convert route: from (default USD), to (required), amount (default 1).

func Rate

func Rate(from, to string) (fromCode, toCode string, err error)

Rate parses parameters for the /rate route: from (default USD) and to (required). Returned codes are uppercased.

func VAT

func VAT(country string) string

VAT parses the optional country parameter for the /vat route. An empty return means "all countries".

Types

This section is empty.

Jump to

Keyboard shortcuts

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