rosetta

module
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0

README

Rosetta 🌹

Go Reference Version Build Status Go Report Card Codecov

A Collection of Translation and Data Manipulation Tools

Rosetta combines several different data manipulation tools into a single module. While each was useful on its own, the dependencies between them made updates hellish, so this collection was born.

Many of these packages pre-date Go generics, and many are being refactored to take advantage of this new capability.

What's Included
  • BCP47 language tags in their one canonical spelling
  • Channel tools for manipulating Go channels
  • Compare values of unknown data types.
  • Convert between arbitrary data types with sensible, configurable defaults.
  • Deep copy and property removal for nested maps and slices
  • First non-empty value from a list of candidates
  • FuncMap helper functions for Go templates
  • HTML conversion tools
  • Iterator tools for iterating over data structures
  • Maps tools for working with map types
  • Pointer to a value whose type is not known at compile time
  • Ranges combinators for iter.Seq iterators
  • Schema validation based on JSON Schema
  • Slice manipulation library
  • Translate data mapping library
Enhanced Data Types
  • Loose types (Int64, String, Template) that accept whatever a remote system or a hand-written file actually sends
  • List parsing library
  • MapOf data type with type safe getters/setters
  • Null-able data types
  • SliceOf data types

Image Used With Permission

© The Trustees of the British Museum. Shared under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) licence.

Pull Requests Welcome

While many parts of this module have been used for years in production environments, it is still a work in progress and will benefit from your experience reports, use cases, and contributions. If you have an idea for making Rosetta better, send in a pull request. We're all in this together! 🌹

Directories

Path Synopsis
Package bcp47 turns any BCP 47 language tag into the one spelling that should be stored.
Package bcp47 turns any BCP 47 language tag into the one spelling that should be stored.
Package channel provides generic combinators for working with Go channels: Filter, Map, Limit, Reverse, Pipe, and conversions to and from slices.
Package channel provides generic combinators for working with Go channels: Filter, Map, Limit, Reverse, Pipe, and conversions to and from slices.
Package compare provides functions for comparing values of arbitrary types.
Package compare provides functions for comparing values of arbitrary types.
Package convert converts values from one type into another, accepting generic input and producing a specific Go type with sensible defaults.
Package convert converts values from one type into another, accepting generic input and producing a specific Go type with sensible defaults.
Package deep copies and searches nested data: the maps and slices that a JSON or database decoder returns, at every level of nesting.
Package deep copies and searches nested data: the maps and slices that a JSON or database decoder returns, at every level of nesting.
Package first returns the first non-empty value from a list of candidates.
Package first returns the first non-empty value from a list of candidates.
Package funcmap provides a registry of helper functions for Go templates.
Package funcmap provides a registry of helper functions for Go templates.
Package html converts between HTML and plain text, sanitizes untrusted markup, and extracts summaries from HTML documents.
Package html converts between HTML and plain text, sanitizes untrusted markup, and extracts summaries from HTML documents.
internal
describe
Package describe turns an error from a standard-library parser into a description that is built only from names: an error kind, a field, a Go type, a line, or an offset.
Package describe turns an error from a standard-library parser into a description that is built only from names: an error kind, a field, a Go type, a line, or an offset.
Package iterator adapts cursor-style collections into slices, channels, and mapped results.
Package iterator adapts cursor-style collections into slices, channels, and mapped results.
Package list treats a delimited string as a list, without splitting it into a slice.
Package list treats a delimited string as a list, without splitting it into a slice.
Package loose provides types that are forgiving about the values they accept.
Package loose provides types that are forgiving about the values they accept.
Package mapof provides string-keyed map types with typed values and helper methods.
Package mapof provides string-keyed map types with typed values and helper methods.
Package maps provides utility functions for working with Go maps: Keys, KeysSorted, Values, and the Equal/NotEqual comparisons.
Package maps provides utility functions for working with Go maps: Keys, KeysSorted, Values, and the Equal/NotEqual comparisons.
Package null provides nullable wrappers around Go primitive types: Bool, String, Int, Int64, and Float, plus the generic Object[T] for everything else.
Package null provides nullable wrappers around Go primitive types: Bool, String, Int, Int64, and Float, plus the generic Object[T] for everything else.
Package pointer returns a pointer to a value whose type is not known at compile time.
Package pointer returns a pointer to a value whose type is not known at compile time.
Package ranges provides combinators for iter.Seq iterators: Filter, Map, Limit, Join, Unique, Empty, and Values, plus Slice to collect one.
Package ranges provides combinators for iter.Seq iterators: Filter, Map, Limit, Join, Unique, Empty, and Values, plus Slice to collect one.
Package schema defines, validates, and manipulates JSON-Schema-like structures in Go.
Package schema defines, validates, and manipulates JSON-Schema-like structures in Go.
format
Package format provides the named string formats used by the schema package.
Package format provides the named string formats used by the schema package.
Package slice provides generic utility functions for working with slices: membership tests (Contains, ContainsAll, ContainsAny), transformations (Map, Filter, Unique, Reverse, Shuffle, Difference, NonZero), and safe element access (At, AtOK, Find, First, Split, RemoveAt).
Package slice provides generic utility functions for working with slices: membership tests (Contains, ContainsAll, ContainsAny), transformations (Map, Filter, Unique, Reverse, Shuffle, Difference, NonZero), and safe element access (At, AtOK, Find, First, Split, RemoveAt).
Package sliceof provides named slice types that carry helper methods: Any, String, Int, Float, MapOfAny, MapOfString, and the generic Object[T].
Package sliceof provides named slice types that carry helper methods: Any, String, Int, Float, MapOfAny, MapOfString, and the generic Object[T].
Package tests holds cross-package integration tests that exercise schema against the mapof and sliceof carrier types together.
Package tests holds cross-package integration tests that exercise schema against the mapof and sliceof carrier types together.
Package translate maps data from one object into another using rules that can be defined in JSON.
Package translate maps data from one object into another using rules that can be defined in JSON.

Jump to

Keyboard shortcuts

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