rosetta

module
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 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
  • Channel tools for manipulating Go channels
  • Compare values of unknown data types.
  • Convert between arbitrary data types with sensible, configurable defaults.
  • HTML conversion tools
  • Iterator tools for iterating over data structures
  • Maps tools for working with map types
  • Schema validation based on JSON Schema
  • Slice manipulation library
  • Translate data mapping library
Enhanced Data Types
  • Lenient scalar types (Int64, String) that accept whatever encoding a remote system 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 channel provides generic combinators for working with Go channels: Filter, Map, Limit, Reverse, Beep, Pipe, and conversions to and from slices.
Package channel provides generic combinators for working with Go channels: Filter, Map, Limit, Reverse, Beep, 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 delta provides collection types that track their own changes.
Package delta provides collection types that track their own changes.
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.
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 lenient provides scalar types that are forgiving about how a remote system encodes them.
Package lenient provides scalar types that are forgiving about how a remote system encodes them.
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 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