naming

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package naming holds the spec-to-Go identifier rules shared by every emitter. All decisions about how a spec, key or enum value becomes a Go name live here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstName

func ConstName(value string) string

ConstName derives the member part of an allowed-value constant.

func ExportName

func ExportName(s string) string

ExportName converts an arbitrary spec name into an exported Go identifier. Word boundaries are non-alphanumeric runs; existing capitalization inside a word is preserved ("Hash-SHA-256" -> "HashSHA256").

func FileName

func FileName(specName string) string

FileName derives the generated file base name for a spec.

func FirstLine

func FirstLine(s string) string

FirstLine returns the first line of free text, trimmed.

func StructName

func StructName(typeIdentifier, specName string) string

StructName derives a Go struct name from a spec's wire type identifier (requesttype, payloadtype or declarationtype), falling back to the spec file name. "DeviceLock" stays "DeviceLock"; "com.apple.configuration.passcode.settings" becomes "PasscodeSettings".

func WrapComment

func WrapComment(s string, width int) []string

WrapComment wraps s into comment-friendly lines of at most width runes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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