casing

package
v0.5.3-alpha09 Latest Latest
Warning

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

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

Documentation

Overview

Package casing provides casing transforms between a snake_case SQL surface and the "native" wire casing used by a foreign API (pascal | kebab | camel | snake).

The forward (snake) transform is a port of botocore's xform_name, so that the snake aliases stackql exposes match what the AWS CLI produces for top-level argument names. The transform is applied to TOP-LEVEL identifiers only; nested struct contents are passed verbatim by the caller and are not transformed here.

Index

Constants

View Source
const (
	Snake  = "snake"
	Pascal = "pascal"
	Kebab  = "kebab"
	Camel  = "camel"
)

Native casing identifiers, as carried by a method's request.nativeCasing.

Variables

This section is empty.

Functions

func FromSnake

func FromSnake(snake, nativeCasing string) string

FromSnake converts a snake_case identifier to the given native casing. It is the inverse used by reverse-casing parameter lookup: a snake SQL key is converted to the wire casing and re-resolved against the parameter / property set.

func IsKnownCasing

func IsKnownCasing(s string) bool

IsKnownCasing reports whether s is a recognised native casing identifier.

func ToCamel

func ToCamel(snake string) string

ToCamel converts snake_case to camelCase (vpc_id -> vpcId).

func ToKebab

func ToKebab(snake string) string

ToKebab converts snake_case to kebab-case (vpc_id -> vpc-id).

func ToPascal

func ToPascal(snake string) string

ToPascal converts snake_case to PascalCase (vpc_id -> VpcId).

func ToSnake

func ToSnake(name string) string

ToSnake converts a wire identifier (PascalCase / camelCase) to snake_case using botocore's xform_name algorithm with '_' as the separator. Acronyms collapse (VPCId -> vpc_id, VPCEndpoint -> vpc_endpoint); the transform is intentionally lossy for acronyms, exactly as the AWS CLI is.

Types

This section is empty.

Jump to

Keyboard shortcuts

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