codegen

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package codegen renders generated Go source for internal/cldr/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatFile

func FormatFile(src []byte) ([]byte, error)

func RenderLanguageMatchingProfile added in v0.2.6

func RenderLanguageMatchingProfile(path string, profile cldr.LanguageMatching) error

func RenderRuntime

func RenderRuntime(outDir string, input RuntimeInput) error

func RenderTimeZoneRegistry added in v0.2.6

func RenderTimeZoneRegistry(path string, registry tzdb.Registry) error

func RenderUnicodeTypeAliases added in v0.2.6

func RenderUnicodeTypeAliases(path string, aliases []cldr.UnicodeTypeAlias) error

Types

type ManifestHash

type ManifestHash struct {
	Name   string
	SHA256 string
}

type ManifestInput

type ManifestInput struct {
	Generator     string
	CLDR          string
	ICU           string
	TZData        string
	LocaleProfile []string
	InputHashes   []ManifestHash
}

type RuntimeInput

type RuntimeInput struct {
	Manifest         ManifestInput
	Locales          extract.Locales
	LikelySubtags    extract.LikelySubtags
	ScriptDirections map[string]bool
	Numbers          extract.Numbers
	Currencies       extract.CurrencyData
	Dates            extract.Dates
	Preferences      cldr.PreferenceData
	Metazones        extract.Metazones
	Units            extract.Units
	ListPatterns     extract.ListPatterns
	RelativeTime     extract.RelativeTimeFields
	DisplayNames     extract.DisplayNames
}

type StringRef

type StringRef struct {
	// contains filtered or unexported fields
}

func (StringRef) String

func (r StringRef) String() string

type StringTable

type StringTable struct {
	// contains filtered or unexported fields
}

func NewStringTable

func NewStringTable() *StringTable

func (*StringTable) Add

func (t *StringTable) Add(s string) StringRef

func (*StringTable) EmitDataConst added in v0.2.6

func (t *StringTable) EmitDataConst(w io.Writer, name string) error

EmitDataConst writes only the string table body as a chunked const with the given name. It emits no package clause, type, or method: the caller owns those. This is the const-only payload form a domain data.go uses, where the sliceRef type and string() method live in the hand-written decode.go instead.

Jump to

Keyboard shortcuts

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